你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

STM32库标识符命名规则

[复制链接]
党国特派员 发布时间:2015-1-28 10:06
Naming conventions
STM32库标识符命名规则


The STM32F10x Standard Peripherals Library uses the following naming conventions:
STM32F10x 标准外设库使用如下的命名规则


PPP refers to any peripheral acronym, for example ADC.
PPP表示外设缩写,比如ADC
System and source/header file names are preceded by the prefix ‘stm32f10x_’.
系统文件或者源文件以及头文件名以stm32f10x_作为前缀


Constants used in one file are defined within this file. A constant used in more than one file is defined in a header file.
All constants are written in upper case.
常量:只在一个文件中使用的常量在该文件中定义,在多于一个文件中使用的常量在头文件中定义。所用常量名使用大写
Registers are considered as constants. Their names are in upper case.
In most cases, the same acronyms as in the STM32F10x reference manual document are used.
寄存器被考虑成常量。名字采用大写。绝大多数情况下,采用与STM32F10x参考手册中相同的缩写作为其名字。


Names of peripheral’s functions are preceded by the corresponding peripheral acronym in upper case followed by an underscore.
The first letter in each word is in upper case, for example USART_SendData.
Only one underscore is allowed in a function name to separate the peripheral acronym from the rest of the function name.
外设函数名采用相应的大写的外设缩写作为前缀,之后紧跟一个下划线(表示分割),每个词的首字母大写,函数名只允许只用一个下划线以分割函数外设缩写与函数名的其他部分。


Functions used to initialize the PPP peripheral according to parameters specified in PPP_InitTypeDef are named PPP_Init, for example TIM_Init.
用于初始化PPP外设的函数命名为PPP_Init,PPP_Init函数根据在结构体PPP_InitTypeDef中指定的参数初始化PPP外设。


Functions used to reset the PPP peripheral registers to their default values are named PPP_DeInit, for example TIM_DeInit.
用于将外设PPP复位为其默认值的函数命名为PPP_DeInit,例如TIM_DeInit.


Functions used to fill the PPP_InitTypeDef structure with the reset values of each member are named PPP_StructInit, for example USART_StructInit.
用于将PPP外设初始化结构体InitTypeDef填充为系统复位默认值的函数命名为PPP_StructInit,例如USART_StructInit


Functions used to enable or disable the specified PPP peripheral are named PPP_Cmd, for example USART_Cmd.
用于禁止或者使能PPP外设的函数命名为PPP_Cmd,例如USART_Cmd.


Functions used to enable or disable an interrupt source of the specified PPP peripheral are named PPP_ITConfig, for example RCC_ITConfig.
用于禁止或者使能PPP外设中断源的函数命名为PPP_ITConfig,例如RCC_ITConfig.


Functions used to enable or disable the DMA interface of the specified PPP peripheral are named PPP_DMAConfig, for example TIM_DMAConfig.
用于禁止或者使能PPP外设DMA接口的函数命名为PPP_DMAConfig,例如TIM_DMAConfig.


Functions used to configure a peripheral function always end with the string ‘Config’, for example GPIO_PinRemapConfig.
用于配置外设功能的函数总是以字符串“Config”结束,例如GPIO_PinRemapConfig.


Functions used to check whether the specified PPP flag is set or reset are named PPP_GetFlagStatus, for example I2C_GetFlagStatus.
用于检查外设是否置位或者复位的函数命名为PPP_GetFlagStatus,例如I2CGetFlagStatus.


Functions used to clear a PPP flag are named PPP_ClearFlag, for example I2C_ClearFlag.
用于清除PPP外设标志位的函数命名为PPP_ClearFlag,例如I2C_ClearFlag.


Functions used to check whether the specified PPP interrupt has occurred or not are named PPP_GetITStatus, for example I2C_GetITStatus.
用于检查PPP外设中断是否发生的函数命名为PPP_GetITStatus,例如I2C_GetITStatus.


Functions used to clear a PPP interrupt pending bit are named PPP_ClearITPendingBit, for example I2C_ClearITPendingBit.
用于清除PPP外设待处理中断位的函数命名为PPP_ClearITPendingBit,例如I2C_ClearITPendingbit.


希望对初学者阅读库有帮助,翻译自STM32标准外设库3.5说明部分
另一方面,建议大家自己认真阅读这些英文,提高自己阅读手册的能力。阅读手册是你绕不过的“砍”


外设缩写


ADC
  Analog/digital converter


BKP
  Backup registers


CAN
  Controller area network


CEC
  Consumer Electronics Control


CRC
  CRC calculation unit


DAC
  Digital to analog converter


DBGMCU
  Debug MCU


DMA
  DMA controller


EXTI
  External interrupt/event controller


FSMC
  Flexible static memory controller


FLASH
Flash memory


GPIO
  General purpose I/O


I2C
  Inter-integrated circuit


I2S
  Inter-integrated sound


IWDG
  Independent watchdog


NVIC
  Nested vectored interrupt controller


PWR
  Power controller


RCC
  Reset and clock controller


RTC
  Reset and clock controller


SDIO
SDIO interface


SPI
Serial peripheral interface


SysTick
System tick timer


TIM
Advanced-control, general-purpose or basic timer


USART
Universal synchronous asynchronous receiver transmitter


WWDG
Window watchdog
收藏 评论21 发布时间:2015-1-28 10:06

举报

21个回答
党国特派员 回答时间:2015-1-29 09:40:23
天天晓宇 发表于 2015-1-28 12:36
这个支持下,楼主发帖好多啊

,为论坛做贡献!
党国特派员 回答时间:2015-1-29 09:41:11

一起学习,共同进步
党国特派员 回答时间:2015-1-29 09:34:57
QianFan 发表于 2015-1-28 20:53
目测是水经验的。。。。

水经验,你可以不看啊。
moyanming2013 回答时间:2015-1-28 12:24:46
过来支持下
stary666 回答时间:2015-1-28 12:26:25
好东西!!!!!!!!!
天天晓宇 回答时间:2015-1-28 12:36:39
这个支持下,楼主发帖好多啊
时光碎了天 回答时间:2015-1-28 12:37:59
学习了的
cxtarm 回答时间:2015-1-28 12:50:12
子曰小玖 回答时间:2015-1-28 14:56:05
学习了!!!!!!
1407W 回答时间:2015-1-28 16:36:34
不觉明历
AnswerRaul 回答时间:2015-1-28 17:02:26
支持一下
wangweili1978 回答时间:2015-1-28 19:42:27
我是来学习的。
qianfan 回答时间:2015-1-28 20:53:14
目测是水经验的。。。。
党国特派员 回答时间:2015-1-29 09:40:53

,这都是最基本的。
12下一页

所属标签

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版