Stm32 register library and Firmware Library

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.