Summarize the differences between register-based and firmware library stm32 programming

What is the difference between register-based and firmware library-based stm32 programming methods

Generally speaking, it is the difference between the professional level or the application level

From an application point of view, registers are relatively low-level, similar to the driver layer, while the firmware library is similar to the application layer after encapsulating the registers. In contrast, the firmware library is more like a product packaged for users. We only need to use it. Let the package deal with the register. When using the register, you must be clear about which register you want to operate. Complicated, you need to understand the underlying configuration of the register.

From a professional point of view, because the registers are more low-level, users are required to understand the basic structure and configuration of the low-level. Therefore, operating registers are more professional than the firmware library. In contrast, directly operating the firmware library does not need to know so much or even not. It can be developed directly without much professional knowledge.

The above can summarize their advantages and disadvantages. The advantages of the
firmware library: it can be directly applied, more convenient to operate, rapid development, and suitable for novices to get started.
Disadvantages of the firmware library: Because the firmware library is operated, it will essentially operate on the registers. Because the middleman of encapsulation is required, the execution speed is slower than the direct operation of the registers. It is not as convenient as register migration.

In general: we can start from the firmware library, and then slowly learn more about registers and related knowledge. In my opinion, it is beneficial and harmless to learn more about the underlying things, and it is more conducive to improving ourselves. You can be lazy, but Can't not.

Guess you like

Origin blog.csdn.net/rude_dragon/article/details/110476873