Naming conventions - o+ L0 y9 E6 `, i. C+ U/ u STM32库标识符命名规则. p4 C. z& P. t# S$ S) \ The STM32F10x Standard Peripherals Library uses the following naming conventions: STM32F10x 标准外设库使用如下的命名规则 ( ~ e9 |1 R6 F2 b- x) R , M5 V9 L4 F5 R6 \) n/ _+ s PPP refers to any peripheral acronym, for example ADC. 0 H7 k( o5 V5 _8 ?5 o! X$ T% D" X PPP表示外设缩写,比如ADC System and source/header file names are preceded by the prefix ‘stm32f10x_’. 0 h" ^, E3 l, _& h" v 系统文件或者源文件以及头文件名以stm32f10x_作为前缀 , L. b# o }6 l' w4 j- V; n+ Y ! |! E9 z9 ^2 _/ r' [" d5 r 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. - A# V T- u j5 h 常量:只在一个文件中使用的常量在该文件中定义,在多于一个文件中使用的常量在头文件中定义。所用常量名使用大写/ x _4 m: V: W2 h5 G8 w' @2 Z( Z9 \ 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参考手册中相同的缩写作为其名字。0 `' R/ W3 o, k9 Z0 P: D5 e * p: b* g, w& B+ O$ |$ T6 C3 Z Names of peripheral’s functions are preceded by the corresponding peripheral acronym in upper case followed by an underscore. % m( J* M& g" e The first letter in each word is in upper case, for example USART_SendData. + x# M& b( G& m- I" m- L% H/ x Only one underscore is allowed in a function name to separate the peripheral acronym from the rest of the function name. 0 ?) g4 O3 x1 i6 e6 i4 @ 外设函数名采用相应的大写的外设缩写作为前缀,之后紧跟一个下划线(表示分割),每个词的首字母大写,函数名只允许只用一个下划线以分割函数外设缩写与函数名的其他部分。% j/ S4 H" s' W/ Y 9 q8 o. h3 A1 I9 V# i z Functions used to initialize the PPP peripheral according to parameters specified in PPP_InitTypeDef are named PPP_Init, for example TIM_Init. / [5 w. @* ?, k0 J1 L# f+ _ 用于初始化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.% q7 K6 Q3 g6 X) O( O ' o& {" q4 i# r8 x. S2 a5 L! J# I W4 w+ \- {- Y; u0 G0 B0 s Functions used to fill the PPP_InitTypeDef structure with the reset values of each member are named PPP_StructInit, for example USART_StructInit. % J4 c4 F. n4 B0 u' B 用于将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. 1 b. V& ?" C9 f$ q7 Q Functions used to enable or disable an interrupt source of the specified PPP peripheral are named PPP_ITConfig, for example RCC_ITConfig. " G3 O7 a* v2 A F 用于禁止或者使能PPP外设中断源的函数命名为PPP_ITConfig,例如RCC_ITConfig. 2 C3 f7 F3 s* o4 v' a & C& d$ ?1 p% S* b& s) W# B* W 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.% B5 e1 |0 @( o! `/ V5 X z2 U# _ $ ^/ {, v, i) U# ]% }$ g Functions used to configure a peripheral function always end with the string ‘Config’, for example GPIO_PinRemapConfig. 用于配置外设功能的函数总是以字符串“Config”结束,例如GPIO_PinRemapConfig. : E& U4 }% T3 W6 ^8 m+ } Functions used to check whether the specified PPP flag is set or reset are named PPP_GetFlagStatus, for example I2C_GetFlagStatus. 用于检查外设是否置位或者复位的函数命名为PPP_GetFlagStatus,例如I2CGetFlagStatus.9 _- m4 J1 W" J$ { i7 G( @: \6 ^ : L* w7 U3 s$ o8 J% e3 f. `1 y' a Functions used to clear a PPP flag are named PPP_ClearFlag, for example I2C_ClearFlag. 7 O% F7 D$ p5 T5 N8 `! _! X 用于清除PPP外设标志位的函数命名为PPP_ClearFlag,例如I2C_ClearFlag.+ B( F4 `& c+ Y/ I% Y # Y7 ?3 J; Z, G: m2 W1 I Functions used to check whether the specified PPP interrupt has occurred or not are named PPP_GetITStatus, for example I2C_GetITStatus. " j- M9 u" q% I 用于检查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.# g7 {- k! D; l5 h) }8 d ( l$ N3 U4 e( K9 H+ v- P u" |2 {2 P3 z6 h/ }: y% z 希望对初学者阅读库有帮助,翻译自STM32标准外设库3.5说明部分 另一方面,建议大家自己认真阅读这些英文,提高自己阅读手册的能力。阅读手册是你绕不过的“砍” 外设缩写9 Y( [# g1 R, e3 q + \ S( t2 l; @* { ADC Analog/digital converter BKP 7 X0 Q% U; n$ A* e9 B$ W F5 m Backup registers 4 a) a8 M7 j' d- G3 u0 c+ J7 F CAN Controller area network 9 N4 b( T' r7 r3 n CEC Consumer Electronics Control 9 ?/ r' X# `8 J4 Y CRC 4 J' @1 ~. {- W Q) _2 s7 d CRC calculation unit 7 R; N t% }& W' S$ `5 { - n5 @4 P9 s* I. D5 k/ J+ K" Q. t DAC 0 ]" q$ s3 H0 q7 M7 ~ Digital to analog converter $ B$ N" |- a1 G$ ^: ~ DBGMCU Debug MCU : D$ t9 _3 w% J! ? DMA ; \1 c2 b) _1 k DMA controller - W* Q9 I2 B6 J0 M EXTI External interrupt/event controller # T: O+ N; | [) w8 B$ t; C 9 B- p7 h6 \. J! e; l0 y! e FSMC " {6 Z* E# M5 H) L Flexible static memory controller 8 s0 N; O+ {( |- _ " W( P7 I5 J9 j! a/ a' `. i- g# | FLASH Flash memory 2 k9 P. ?( B0 _3 [6 e$ s GPIO : }9 C4 l: z( A* A5 ` General purpose I/O ; p1 c1 ^. \. z. C' S * D1 J0 f, Q# F" |+ G9 f/ n& s. E I2C Inter-integrated circuit 8 N: H- X+ c/ k% Z I2S % b" a p2 J% d) y" |$ ~ Inter-integrated sound 7 q9 }3 b! S( W+ x4 h. p + W5 u) ^, l4 |7 ?* O IWDG Independent watchdog & {: z8 |: U$ F0 z$ j$ A NVIC 2 }- K% O! d, ?4 T$ R9 l1 E8 G Nested vectored interrupt controller " f/ F0 ^/ w* Y% W PWR 3 t' S2 E* a* `$ |6 F4 K! m Power controller 3 S2 v; A Z" P4 |- F1 ?1 H4 f: ^ 8 E+ v0 x# g5 W+ r2 g4 x0 {$ H RCC ) h+ o0 T( {/ y# N$ m& Y0 R4 l Reset and clock controller # E; i0 I3 T, r! r' P2 z ` 1 m2 E b: v. D RTC " `7 P6 M( Q* h5 i* v C Reset and clock controller : h4 W# s' I7 }! S# g2 r SDIO SDIO interface / |4 Y* d3 u* F' a7 N5 V$ j+ p* v " t2 R0 Q4 Z; b0 y SPI Serial peripheral interface 5 Q) ]4 K* u2 H$ s& S J % u7 G$ d/ ]& u SysTick * a( G/ Q5 k* [5 r- ^- X System tick timer * E$ Z9 }* G* w) ?1 |% \7 O& ? 5 ~, f9 [1 @0 E& }, | TIM Advanced-control, general-purpose or basic timer USART , e* x* R: I, j& y1 M Universal synchronous asynchronous receiver transmitter * R( ~! U$ x- a WWDG Window watchdog $ \5 {( m- @5 u( E2 I" V, o$ \ |
,为论坛做贡献!
一起学习,共同进步
水经验,你可以不看啊。
,这都是最基本的。