UM1940
USART_InitTypeDef Init
uint8_t * pTxBuffPtr
uint16_t TxXferSize
__IO uint16_t TxXferCount
uint8_t * pRxBuffPtr
uint16_t RxXferSize
__IO uint16_t RxXferCount
DMA_HandleTypeDef * hdmatx
DMA_HandleTypeDef * hdmarx
HAL_LockTypeDef Lock
__IO HAL_USART_StateTypeDef State
__IO uint32_t ErrorCode
Field Documentation
USART_TypeDef* USART_HandleTypeDef::Instance
USART_InitTypeDef USART_HandleTypeDef::Init
uint8_t* USART_HandleTypeDef::pTxBuffPtr
uint16_t USART_HandleTypeDef::TxXferSize
__IO uint16_t USART_HandleTypeDef::TxXferCount
uint8_t* USART_HandleTypeDef::pRxBuffPtr
uint16_t USART_HandleTypeDef::RxXferSize
__IO uint16_t USART_HandleTypeDef::RxXferCount
DMA_HandleTypeDef* USART_HandleTypeDef::hdmatx
DMA_HandleTypeDef* USART_HandleTypeDef::hdmarx
HAL_LockTypeDef USART_HandleTypeDef::Lock
__IO HAL_USART_StateTypeDef USART_HandleTypeDef::State
__IO uint32_t USART_HandleTypeDef::ErrorCode
48.2
USART Firmware driver API description
48.2.1
How to use this driver
The USART HAL driver can be used as follows:
1.
Declare a USART_HandleTypeDef handle structure.
2.
Initialize the USART low level resources by implementing the HAL_USART_MspInit ()
API:
a.
b.
c.
d.
Enable the USARTx interface clock.
USART pins configuration:
Enable the clock for the USART GPIOs.
Configure these USART pins as alternate function pull-up.
NVIC configuration if you need to use interrupt process
(HAL_USART_Transmit_IT(), HAL_USART_Receive_IT() and
HAL_USART_TransmitReceive_IT() APIs):
Configure the USARTx interrupt priority.
Enable the NVIC USART IRQ handle.
DMA Configuration if you need to use DMA process
(HAL_USART_Transmit_DMA() HAL_USART_Receive_IT() and
HAL_USART_TransmitReceive_IT() APIs):
Declare a DMA handle structure for the Tx/Rx stream.
Enable the DMAx interface clock.
Configure the declared DMA handle structure with the required Tx/Rx
parameters.
Configure the DMA Tx/Rx Stream.
DocID028236 Rev 2
HAL USART Generic Driver
673/1371
Need help?
Do you have a question about the STM32F2 and is the answer not in the manual?
Questions and answers