STM32F4xx_HAL_Driver  1.8.3
USART Exported Types
+ Collaboration diagram for USART Exported Types:

Data Structures

struct  USART_InitTypeDef
 USART Init Structure definition. More...
 
struct  __USART_HandleTypeDef
 USART handle Structure definition. More...
 

Typedefs

typedef struct __USART_HandleTypeDef USART_HandleTypeDef
 USART handle Structure definition.
 
typedef void(* pUSART_CallbackTypeDef) (USART_HandleTypeDef *husart)
 HAL USART Callback pointer definition. More...
 

Enumerations

enum  HAL_USART_StateTypeDef {
  HAL_USART_STATE_RESET = 0x00U , HAL_USART_STATE_READY = 0x01U , HAL_USART_STATE_BUSY = 0x02U , HAL_USART_STATE_BUSY_TX = 0x12U ,
  HAL_USART_STATE_BUSY_RX = 0x22U , HAL_USART_STATE_BUSY_TX_RX = 0x32U , HAL_USART_STATE_TIMEOUT = 0x03U , HAL_USART_STATE_ERROR = 0x04U
}
 HAL State structures definition. More...
 
enum  HAL_USART_CallbackIDTypeDef {
  HAL_USART_TX_HALFCOMPLETE_CB_ID = 0x00U , HAL_USART_TX_COMPLETE_CB_ID = 0x01U , HAL_USART_RX_HALFCOMPLETE_CB_ID = 0x02U , HAL_USART_RX_COMPLETE_CB_ID = 0x03U ,
  HAL_USART_TX_RX_COMPLETE_CB_ID = 0x04U , HAL_USART_ERROR_CB_ID = 0x05U , HAL_USART_ABORT_COMPLETE_CB_ID = 0x06U , HAL_USART_MSPINIT_CB_ID = 0x07U ,
  HAL_USART_MSPDEINIT_CB_ID = 0x08U
}
 HAL USART Callback ID enumeration definition. More...
 

Detailed Description


Data Structure Documentation

◆ USART_InitTypeDef

struct USART_InitTypeDef

USART Init Structure definition.

Definition at line 46 of file stm32f4xx_hal_usart.h.

Data Fields
uint32_t BaudRate

This member configures the Usart communication baud rate. The baud rate is computed using the following formula:

  • IntegerDivider = ((PCLKx) / (8 * (husart->Init.BaudRate)))
  • FractionalDivider = ((IntegerDivider - ((uint32_t) IntegerDivider)) * 8) + 0.5
uint32_t CLKLastBit

Specifies whether the clock pulse corresponding to the last transmitted data bit (MSB) has to be output on the SCLK pin in synchronous mode. This parameter can be a value of USART Last Bit

uint32_t CLKPhase

Specifies the clock transition on which the bit capture is made. This parameter can be a value of USART Clock Phase

uint32_t CLKPolarity

Specifies the steady state of the serial clock. This parameter can be a value of USART Clock Polarity

uint32_t Mode

Specifies whether the Receive or Transmit mode is enabled or disabled. This parameter can be a value of USART Mode

uint32_t Parity

Specifies the parity mode. This parameter can be a value of USART Parity

Note
When parity is enabled, the computed parity is inserted at the MSB position of the transmitted data (9th bit when the word length is set to 9 data bits; 8th bit when the word length is set to 8 data bits).
uint32_t StopBits

Specifies the number of stop bits transmitted. This parameter can be a value of USART Number of Stop Bits

uint32_t WordLength

Specifies the number of data bits transmitted or received in a frame. This parameter can be a value of USART Word Length

◆ __USART_HandleTypeDef

struct __USART_HandleTypeDef

USART handle Structure definition.

Definition at line 98 of file stm32f4xx_hal_usart.h.

+ Collaboration diagram for __USART_HandleTypeDef:

Data Fields

USART_TypeDef * Instance
 
USART_InitTypeDef Init
 
const uint8_t * pTxBuffPtr
 
uint16_t TxXferSize
 
__IO uint16_t TxXferCount
 
uint8_t * pRxBuffPtr
 
uint16_t RxXferSize
 
__IO uint16_t RxXferCount
 
DMA_HandleTypeDefhdmatx
 
DMA_HandleTypeDefhdmarx
 
HAL_LockTypeDef Lock
 
__IO HAL_USART_StateTypeDef State
 
__IO uint32_t ErrorCode
 
void(* TxHalfCpltCallback )(struct __USART_HandleTypeDef *husart)
 
void(* TxCpltCallback )(struct __USART_HandleTypeDef *husart)
 
void(* RxHalfCpltCallback )(struct __USART_HandleTypeDef *husart)
 
void(* RxCpltCallback )(struct __USART_HandleTypeDef *husart)
 
void(* TxRxCpltCallback )(struct __USART_HandleTypeDef *husart)
 
void(* ErrorCallback )(struct __USART_HandleTypeDef *husart)
 
void(* AbortCpltCallback )(struct __USART_HandleTypeDef *husart)
 
void(* MspInitCallback )(struct __USART_HandleTypeDef *husart)
 
void(* MspDeInitCallback )(struct __USART_HandleTypeDef *husart)
 

Field Documentation

◆ AbortCpltCallback

void(* __USART_HandleTypeDef::AbortCpltCallback) (struct __USART_HandleTypeDef *husart)

USART Abort Complete Callback

Definition at line 133 of file stm32f4xx_hal_usart.h.

◆ ErrorCallback

void(* __USART_HandleTypeDef::ErrorCallback) (struct __USART_HandleTypeDef *husart)

USART Error Callback

Definition at line 132 of file stm32f4xx_hal_usart.h.

◆ ErrorCode

__IO uint32_t __USART_HandleTypeDef::ErrorCode

USART Error code

Definition at line 124 of file stm32f4xx_hal_usart.h.

◆ hdmarx

DMA_HandleTypeDef* __USART_HandleTypeDef::hdmarx

Usart Rx DMA Handle parameters

Definition at line 118 of file stm32f4xx_hal_usart.h.

◆ hdmatx

DMA_HandleTypeDef* __USART_HandleTypeDef::hdmatx

Usart Tx DMA Handle parameters

Definition at line 116 of file stm32f4xx_hal_usart.h.

◆ Init

USART_InitTypeDef __USART_HandleTypeDef::Init

Usart communication parameters

Definition at line 102 of file stm32f4xx_hal_usart.h.

◆ Instance

USART_TypeDef* __USART_HandleTypeDef::Instance

USART registers base address

Definition at line 100 of file stm32f4xx_hal_usart.h.

◆ Lock

HAL_LockTypeDef __USART_HandleTypeDef::Lock

Locking object

Definition at line 120 of file stm32f4xx_hal_usart.h.

◆ MspDeInitCallback

void(* __USART_HandleTypeDef::MspDeInitCallback) (struct __USART_HandleTypeDef *husart)

USART Msp DeInit callback

Definition at line 136 of file stm32f4xx_hal_usart.h.

◆ MspInitCallback

void(* __USART_HandleTypeDef::MspInitCallback) (struct __USART_HandleTypeDef *husart)

USART Msp Init callback

Definition at line 135 of file stm32f4xx_hal_usart.h.

◆ pRxBuffPtr

uint8_t* __USART_HandleTypeDef::pRxBuffPtr

Pointer to Usart Rx transfer Buffer

Definition at line 110 of file stm32f4xx_hal_usart.h.

◆ pTxBuffPtr

const uint8_t* __USART_HandleTypeDef::pTxBuffPtr

Pointer to Usart Tx transfer Buffer

Definition at line 104 of file stm32f4xx_hal_usart.h.

◆ RxCpltCallback

void(* __USART_HandleTypeDef::RxCpltCallback) (struct __USART_HandleTypeDef *husart)

USART Rx Complete Callback

Definition at line 130 of file stm32f4xx_hal_usart.h.

◆ RxHalfCpltCallback

void(* __USART_HandleTypeDef::RxHalfCpltCallback) (struct __USART_HandleTypeDef *husart)

USART Rx Half Complete Callback

Definition at line 129 of file stm32f4xx_hal_usart.h.

◆ RxXferCount

__IO uint16_t __USART_HandleTypeDef::RxXferCount

Usart Rx Transfer Counter

Definition at line 114 of file stm32f4xx_hal_usart.h.

◆ RxXferSize

uint16_t __USART_HandleTypeDef::RxXferSize

Usart Rx Transfer size

Definition at line 112 of file stm32f4xx_hal_usart.h.

◆ State

__IO HAL_USART_StateTypeDef __USART_HandleTypeDef::State

Usart communication state

Definition at line 122 of file stm32f4xx_hal_usart.h.

◆ TxCpltCallback

void(* __USART_HandleTypeDef::TxCpltCallback) (struct __USART_HandleTypeDef *husart)

USART Tx Complete Callback

Definition at line 128 of file stm32f4xx_hal_usart.h.

◆ TxHalfCpltCallback

void(* __USART_HandleTypeDef::TxHalfCpltCallback) (struct __USART_HandleTypeDef *husart)

USART Tx Half Complete Callback

Definition at line 127 of file stm32f4xx_hal_usart.h.

◆ TxRxCpltCallback

void(* __USART_HandleTypeDef::TxRxCpltCallback) (struct __USART_HandleTypeDef *husart)

USART Tx Rx Complete Callback

Definition at line 131 of file stm32f4xx_hal_usart.h.

◆ TxXferCount

__IO uint16_t __USART_HandleTypeDef::TxXferCount

Usart Tx Transfer Counter

Definition at line 108 of file stm32f4xx_hal_usart.h.

◆ TxXferSize

uint16_t __USART_HandleTypeDef::TxXferSize

Usart Tx Transfer size

Definition at line 106 of file stm32f4xx_hal_usart.h.

Typedef Documentation

◆ pUSART_CallbackTypeDef

typedef void(* pUSART_CallbackTypeDef) (USART_HandleTypeDef *husart)

HAL USART Callback pointer definition.

pointer to an USART callback function

Definition at line 163 of file stm32f4xx_hal_usart.h.

Enumeration Type Documentation

◆ HAL_USART_CallbackIDTypeDef

HAL USART Callback ID enumeration definition.

Enumerator
HAL_USART_TX_HALFCOMPLETE_CB_ID 

USART Tx Half Complete Callback ID

HAL_USART_TX_COMPLETE_CB_ID 

USART Tx Complete Callback ID

HAL_USART_RX_HALFCOMPLETE_CB_ID 

USART Rx Half Complete Callback ID

HAL_USART_RX_COMPLETE_CB_ID 

USART Rx Complete Callback ID

HAL_USART_TX_RX_COMPLETE_CB_ID 

USART Tx Rx Complete Callback ID

HAL_USART_ERROR_CB_ID 

USART Error Callback ID

HAL_USART_ABORT_COMPLETE_CB_ID 

USART Abort Complete Callback ID

HAL_USART_MSPINIT_CB_ID 

USART MspInit callback ID

HAL_USART_MSPDEINIT_CB_ID 

USART MspDeInit callback ID

Definition at line 145 of file stm32f4xx_hal_usart.h.

◆ HAL_USART_StateTypeDef

HAL State structures definition.

Enumerator
HAL_USART_STATE_RESET 

Peripheral is not yet Initialized

HAL_USART_STATE_READY 

Peripheral Initialized and ready for use

HAL_USART_STATE_BUSY 

an internal process is ongoing

HAL_USART_STATE_BUSY_TX 

Data Transmission process is ongoing

HAL_USART_STATE_BUSY_RX 

Data Reception process is ongoing

HAL_USART_STATE_BUSY_TX_RX 

Data Transmission Reception process is ongoing

HAL_USART_STATE_TIMEOUT 

Timeout state

HAL_USART_STATE_ERROR 

Error

Definition at line 83 of file stm32f4xx_hal_usart.h.