EasyManuals Logo

ST STM32F2 User Manual

ST STM32F2
1371 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #44 background imageLoading...
Page #44 background image
Overview of HAL drivers
UM1940
44/1371
DocID028236 Rev 2
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
Configuration item
Description
Default Value
HSE_VALUE
Defines the value of the external
oscillator (HSE) expressed in Hz.
The user must adjust this define
statement when using a different
crystal value.
25 000 000 (Hz)
HSE_STARTUP_TIMEOUT
Timeout for HSE start-up,
expressed in ms
5000
HSI_VALUE
Defines the value of the internal
oscillator (HSI) expressed in Hz.
16 000 000 (Hz)
EXTERNAL_CLOCK_VALUE
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.
12288000 (Hz)

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F2 and is the answer not in the manual?

ST STM32F2 Specifications

General IconGeneral
BrandST
ModelSTM32F2
CategoryMicrocontrollers
LanguageEnglish

Related product manuals