From the STM32 Firmware Library, the STM32 Firmware Library

Source: Internet
Author: User

From the STM32 Firmware Library, the STM32 Firmware Library

 

 

The biggest difference between STM32 and general single-chip microcomputer/ARM7 is that it has many registers, and it is difficult for users to write down all of them. Therefore, ST officially provides a set of library function source code according to the specifications, you can directly operate the database functions to perform register operations.

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 ).

In the previous 51 Single-Chip Microcomputer Development, we often directly operate on registers, such as controlling the I/O port status:

P0 = 0x11;

During the development of STM32, register operations are also performed:

GPIOx-> BRR = 0x0011;

To control the BRR register to implement level control, there is an officially encapsulated function, as shown below:

Void GPIO_ResetBits (GPIO_TypeDef * GPIO, uint16_t GPIO_Pin) {GPIO-> BRR = GPIO_Pin ;}

 

In this case, you do not need to directly operate the BRR register. You only need to know how to use the GPIO_ResetBits () function.

 

Related Article

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.