STM32 Firmware Library naming rules

Source: Internet
Author: User

1, the System file name and the source file name in the form of ' stm32f10x_ '.
2. Constants used in a single file are defined in the file. Constants used in multiple files are defined in the header file. All constants are represented in uppercase letters.

3, register as a constant view, also in uppercase letters, in most cases, in the stm3210x reference manual using the same abbreviation.
4, the peripheral module function of the name, need to have the corresponding peripheral module abbreviation underlined such prefix, each word to capitalize the first character. For example Spi_senddata, in a function name, only one underline is allowed to distinguish between the peripheral module abbreviation and the remaining function name.
5. Use the parameters specified in X_inittypedef to initialize the function of the X peripheral module, which is named X_init.
6, reset the X peripheral module register as the default value of the function, named X_deinit.
7. Set each member of the x_inittypedef struct as a function of the reset value, named X_structinit.
8, used to enable or prohibit the specified X peripheral function, named X_cmd.
9, to enable or prohibit the specified X peripheral module of an interrupt resource function, named X_itconfig.

10. A function for enabling or prohibiting the DMA interface of the specified X peripheral module, named X_dmaconfig.
11, the function used to set a peripheral module, always end with the string ' Config '.
12. Used to verify that the flag specified by x is named X_getflagstatus by the function of position or zeroing.
13, used to clear the flag function of an x, named X_clearflag
14. A function to verify that the interrupt of the specified x is occurring, named X_getitstatus
15. A function to clear an X interrupt suspend bit, named X_clearitpendingbit

STM32 Firmware Library naming rules

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.