Activity 2.2.4. Finding Configuration Details in the Reference Manual.
You know what MODER, PUPDR, and IDR do, but not yet the specific bit values to write. Open the reference manual (RM0490), navigate to the General-purpose I/Os (GPIO) section via the table of contents, then go to RM0490 ยง6.4, GPIO registers. Looking up register details in the reference manual is something you will keep doing in this course.
One note on naming before you start.
GPIOx_MODER is the registerโs name in the reference manual. GPIOx->MODER is a dereferenced pointer to the memory location that register is mapped to, so to change GPIOx_MODER we write to GPIOx->MODER, and that is the form weโll always use in code.
(a)
Find
GPIOx_MODER (RM0490 ยง6.4.1). What two-bit value selects input mode? What is the power-on default for all pins?
(b)
Find
GPIOx_PUPDR. Which two-bit value enables the internal pull-up? What C statements enable the pull-up on PB4 (pin 4 of Port B), using bit masks?






