With the concept of interfacing a push button form previous post , lets interface another push button which is connected to PF_0 as SW2. But PF_0 has an alternative function which is MISO of spi-1. So because of this we need to follow the below mentioed procedure to read data from PF_0 pin. Before we learn how to read data from PF_0, let look into GPIO_LOCK and GPIO_CR registers. GPIO_LOCK: This register controls the write access to GPIO_CR . Writing 0x4C4F434B to this register unlocks GPIO_CR , writing any other value enables the lock on GPIO_CR . After the GPIO_CR is updated or written with new values, it reapplies the lock. This process needs to be repeated every time GPIO_CR register needs to be written. GPIO_CR: This is a commit register. The value of this register determines which bits of GPIO_AFSEL, GPIO_PUR, GPIO_PDR, GPIO_DEN are committed when write to these registers is performed. If the bit in the GPIO_CR is cleared, the corresponding ...
A blog on understanding things with simplicity...