Professional Documents
Culture Documents
GPIO I/O
Input and output can be taken from or directed to data register or another peripheral
Output - push-pull, open drain + pull-up/pull-down
Input - floating, pull-up/pull-down, analog
Pull down register connected GND and pull up is to +5V
GPIO speed register controls the slew rate or the rate at which a signal can change between
low/high values
Problems
All GPIO MODER Pins to 01 => 0x55555555
11 => 0xFFFFFFFF
ODR generally follows pin numbers from 1-16(a big maybe) and index numbers from 0-15
Referencing a memory address
The qualifier "volatile" informs the compiler that the value may have changed even
though no statements in the program updates it
3 useless methods -> direct, pointer, variable
Component analysis while performing a task at GPIOB
Solving a problem statement using incrementation
foo() function for incrementation (static int is used)
BX lr to exit from subroutine
Memory Alignment
"ALIGN" directive gives data alignment requirements to compilers. The syntax is "ALIGN
boundary, offset". The boundary is any power of 2. The default boundary is 4, making the
next variable align to a word boundary. The offset specifies how many bytes the next variable
should start from the word boundary. The default offset is 0.
LSL vs LSLS