2.5 HAL driver rules
2.5.1 HAL API naming rules
The following naming rules are used in HAL drivers:
Table 6: HAL API naming rules
stm32f2xx_hal_ppp_ex (c/h)
stm32f2xx_ hal_ppp_ex (c/h)
HAL_PPP_Function
HAL_PPP_FeatureFunctio
n_MODE
HAL_PPPEx_Function
HAL_PPPEx_FeatureFunction_
MODE
HAL_PPPEx_Function
HAL_PPPEx_FeatureFunction_
MODE
HAL_PPP_Structname
TypeDef
The PPP prefix refers to the peripheral functional mode and not to the peripheral itself.
For example, if the USART, PPP can be USART, IRDA, UART or SMARTCARD
depending on the peripheral mode.
The constants used in one file are defined within this file. A constant used in several
files is defined in a header file. All constants are written in uppercase, except for
peripheral driver function parameters.
typedef variable names should be suffixed with _TypeDef.
Registers are considered as constants. In most cases, their name is in uppercase and
uses the same acronyms as in thestm32f2xx reference manuals.
Peripheral registers are declared in the PPP_TypeDef structure (e.g. ADC_TypeDef)
in stm32f2xxx.h header file.stm32f2xxx.h corresponds to stm32f205xx.h ,
stm32f215.h, stm32f207xx.h or stm32f217xx.h.
Peripheral function names are prefixed by HAL_, then the corresponding peripheral
acronym in uppercase followed by an underscore. The first letter of each word is in
uppercase (e.g. HAL_UART_Transmit()). Only one underscore is allowed in a function
name to separate the peripheral acronym from the rest of the function name.