HAL USART Overview ¶
Introducing USART ¶
- group USART_Introduction
-
The USART hardware abstraction layer provides a set of APIs to interface with the STM32 USART (Universal Synchronous/Asynchronous Receiver Transmitter) peripheral using the SPI communication protocol.
It simplifies the configuration, initialization, and management of synchronous USART communication by supporting various modes such as polling, interrupt, and DMA for efficient data transfer.
This abstraction layer ensures portability and ease of use across different STM32 series.
Module and files ¶
The following diagram illustrates the USART module and its associated files.
Component diagram ¶
The following diagram illustrates the software components involved in the USART module. It shows the interactions between the user application, HAL drivers, low-level drivers, and the hardware components.
Configuration table ¶
The following table lists the configuration defines for the HAL USART module, specifying their locations, default values, and descriptions:
- group USART_Configuration_Table
-
¶
Configuration inside the USART driver: ¶
Software configuration defined in stm32c5xx_hal_conf.h:
Preprocessor flags
Default value
Comment
USE_HAL_USART_MODULE
1
Enable HAL USART driver module
USE_HAL_USART_REGISTER_CALLBACKS
0
Allow the user to define a callback
USE_HAL_USART_DMA
1
Enable DMA code in USART
USE_HAL_CHECK_PARAM
0
Enable runtime parameter checks
USE_HAL_USART_CLK_ENABLE_MODEL
HAL_CLK_ENABLE_NO
Enable the gating of the peripheral clock
USE_HAL_CHECK_PROCESS_STATE
0
Enable atomicity of process state checks
USE_HAL_MUTEX
0
Enable semaphore creation for the OS
USE_HAL_USART_USER_DATA
0
Add user data inside the HAL USART handle
USE_HAL_USART_GET_LAST_ERRORS
0
Enable retrieval of last process error codes
USE_HAL_USART_FIFO
0
Enable FIFO code in HAL USART
Software configuration defined in preprocessor environment:
Preprocessor flags
Default value
Comment
USE_ASSERT_DBG_PARAM
Not defined
Enable parameter checks for HAL and LL
USE_ASSERT_DBG_STATE
Not defined
Enable state checks for HAL