Defining and creating registers through documentation insights
In the previous section, we established that the User LED is connected to pin PA5. This means that it is linked to pin number 5 on GPIO PORTA. In other words, to get to the LED, we have to go through PORTA and then locate pin number 5 of that port.
As illustrated in Figure 2.10, the microcontroller has exposed pins on all four sides. These pins are organized into distinct groups known as ports. For instance, pins in PORTA are denoted with the PA prefix, while those in PORTB start with PB, and so forth. This systematic arrangement allows us to easily identify and access specific pins for programming and hardware interfacing tasks.
Figure 2.10: STM32F411 pinout
In the next section, we will go through the steps to locate the precise address of GPIO PORTA.
Locating GPIO PORTA
To effectively interact with any part of our microcontroller, it’s essential to know the memory address...