Differences and links between register and Firmware Library Development
The Firmware Library is a set of functions. The function of the Firmware Library is responsible for directly dealing with registers and providing APIs called by the user functions ).
During 51 development, we often operate registers directly. For example, to control the status of some IO ports, we directly
Operation register:
P0 = 0x11;
During the development of stm32, we can also operate on registers:
Gpiox-> BRR = 0x0011;
This method is acceptable, but the disadvantage of this method is that you need to master the usage of each register before you can use it correctly.
Stm32, and for MCU of the stm32 level, it is easy to remember hundreds of registers. So st (Italian law
Semiconductor) released the official Firmware Library, which encapsulates the underlying operations of these registers and provides a complete set of APIs)
For developers to call. In most cases, you do not need to know which register to operate. You only need to know which registers to call.
Function.
For example, the above control BRR registers implement level control. The official library encapsulates a function:
Void gpio_resetbits (gpio_typedef * gpiox, uint16_t gpio_pin)
{
Alentek warship stm32 Development Board
Www.openedv.com
37
Gpiox-> BRR = gpio_pin;
}
At this time, you do not need to directly operate the BRR register. You only need to know how to use the gpio_resetbits ()
Function. After you have a certain understanding of the working principle of peripherals, you can look at the Firmware Library Function, basically the Function
The name tells you what the function is and how to use it. Is it much more convenient for development?
Any processor, no matter how advanced it is, is ultimately to operate the Processor register. But solid
The component library is not omnipotent. If you want to thoroughly learn stm32, it is far from enough to read the stm32 Firmware Library. You still want it
Understand the principles of stm32 and understand these principles. During the Firmware Library Development Process, you may be able to gain ease in the game.
More than one.
Stm32 register library and Firmware Library