Typedef enum
{
HAL_OK = 0x00, HAL_ERROR = 0x01, HAL_BUSY = 0x02, HAL_TIMEOUT = 0x03
} HAL_StatusTypeDef;
HAL Locked The HAL lock is used by all HAL APIs to prevent accessing by accident
shared resources.
typedef enum
{
HAL_UNLOCKED = 0x00, /*!<Resources unlocked */
HAL_LOCKED = 0x01 /*!< Resources locked */
} HAL_LockTypeDef;
In addition to common resources, the stm32f2xx_hal_def.h file calls the stm32f2xx.h
file in CMSIS library to get the data structures and the address mapping for all
peripherals:
Declarations of peripheral registers and bits definition.
Macros to access peripheral registers hardware (Write register, Read
register…etc.).
Common macros
Macro defining HAL_MAX_DELAY
#define HAL_MAX_DELAY 0xFFFFFFFF
Macro linking a PPP peripheral to a DMA structure pointer:__HAL_LINKDMA();
#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD_, __DMA_HANDLE_) \
do{ \
(__HANDLE__)->__PPP_DMA_FIELD_ = &(__DMA_HANDLE_);\
(__DMA_HANDLE_).Parent = (__HANDLE__); \
} while(0)
2.10 HAL configuration
The configuration file, stm32f2xx_hal_conf.h, allows customizing the drivers for the user
application. Modifying this configuration is not mandatory: the application can use the
default configuration without any modification.
To configure these parameters, the user should enable, disable or modify some options by
uncommenting, commenting or modifying the values of the related define statements as
described in the table below:
Table 11: Define statements used for HAL configuration
Defines the value of the external
oscillator (HSE) expressed in Hz.
The user must adjust this define
statement when using a different
crystal value.
Timeout for HSE start-up,
expressed in ms
Defines the value of the internal
oscillator (HSI) expressed in Hz.
This value is used by the I2S
HAL module to compute the I2S
clock source frequency, this
source is inserted directly
through I2S_CKIN pad.