Fortunately, it is not necessary for a programmer to look up all these
values as they are defined in the library file stm32f10x.h as USART1_BASE, SPI1_BASE, TIM1_BASE ADC1_BASE, etc.
Typically, each peripheral will have control registers to configure the peripheral, status registers to determine the current peripheral status, and data registers to read data from and write data to the peripheral. Each GPIO port (GPIOA, GPIOB, etc.) has seven registers. Two are used to configure the sixteen port bits individually, two are used to read/write the sixteen port bits in parallel, two are used to set/reset the sixteen port bits individually, and one is used to implement a “locking sequence” that is intended to prevent rogue code from accidentally modifying the port configuration. This final feature can help minimize the possibility that software bugs lead to hardware failures; e.g, accidentally causing a short circuit.
In addition to providing the addresses of the peripherals, stm32f10x.h also provides C language level structures that can be used to access each peripherals. For example, the GPIO ports are defined by the following register structure.