STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
UART Private Functions
Collaboration diagram for UART Private Functions:

Functions

HAL_StatusTypeDef UART_Start_Receive_IT (UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
 Start Receive operation in interrupt mode.
 
HAL_StatusTypeDef UART_Start_Receive_DMA (UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size)
 Start Receive operation in DMA mode.
 
static void UART_EndTxTransfer (UART_HandleTypeDef *huart)
 End ongoing Tx transfer on UART peripheral (following error detection or Transmit completion).
 
static void UART_EndRxTransfer (UART_HandleTypeDef *huart)
 End ongoing Rx transfer on UART peripheral (following error detection or Reception completion).
 
static void UART_DMATransmitCplt (DMA_HandleTypeDef *hdma)
 Initialize the callbacks to their default values.
 
static void UART_DMAReceiveCplt (DMA_HandleTypeDef *hdma)
 DMA UART receive process complete callback.
 
static void UART_DMATxHalfCplt (DMA_HandleTypeDef *hdma)
 DMA UART transmit process half complete callback.
 
static void UART_DMARxHalfCplt (DMA_HandleTypeDef *hdma)
 DMA UART receive process half complete callback.
 
static void UART_DMAError (DMA_HandleTypeDef *hdma)
 DMA UART communication error callback.
 
static void UART_DMAAbortOnError (DMA_HandleTypeDef *hdma)
 DMA UART communication abort callback, when initiated by HAL services on Error (To be called at end of DMA Abort procedure following error occurrence).
 
static void UART_DMATxAbortCallback (DMA_HandleTypeDef *hdma)
 DMA UART Tx communication abort callback, when initiated by user (To be called at end of DMA Tx Abort procedure following user abort request).
 
static void UART_DMARxAbortCallback (DMA_HandleTypeDef *hdma)
 DMA UART Rx communication abort callback, when initiated by user (To be called at end of DMA Rx Abort procedure following user abort request).
 
static void UART_DMATxOnlyAbortCallback (DMA_HandleTypeDef *hdma)
 DMA UART Tx communication abort callback, when initiated by user by a call to HAL_UART_AbortTransmit_IT API (Abort only Tx transfer) (This callback is executed at end of DMA Tx Abort procedure following user abort request, and leads to user Tx Abort Complete callback execution).
 
static void UART_DMARxOnlyAbortCallback (DMA_HandleTypeDef *hdma)
 DMA UART Rx communication abort callback, when initiated by user by a call to HAL_UART_AbortReceive_IT API (Abort only Rx transfer) (This callback is executed at end of DMA Rx Abort procedure following user abort request, and leads to user Rx Abort Complete callback execution).
 
static HAL_StatusTypeDef UART_Transmit_IT (UART_HandleTypeDef *huart)
 Sends an amount of data in non blocking mode.
 
static HAL_StatusTypeDef UART_EndTransmit_IT (UART_HandleTypeDef *huart)
 Wraps up transmission in non blocking mode.
 
static HAL_StatusTypeDef UART_Receive_IT (UART_HandleTypeDef *huart)
 Receives an amount of data in non blocking mode.
 
static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout (UART_HandleTypeDef *huart, uint32_t Flag, FlagStatus Status, uint32_t Tickstart, uint32_t Timeout)
 This function handles UART Communication Timeout. It waits until a flag is no longer in the specified status.
 
static void UART_SetConfig (UART_HandleTypeDef *huart)
 Configures the UART peripheral.
 

Detailed Description

Function Documentation

◆ UART_Start_Receive_IT()

HAL_StatusTypeDef UART_Start_Receive_IT ( UART_HandleTypeDef * huart,
uint8_t * pData,
uint16_t Size )

#include <stm32f4xx_hal_uart.h>

Start Receive operation in interrupt mode.

Note
This function could be called by all HAL UART API providing reception in Interrupt mode.
When calling this function, parameters validity is considered as already checked, i.e. Rx State, buffer address, ... UART Handle is assumed as Locked.
Parameters
huartUART handle.
pDataPointer to data buffer (u8 or u16 data elements).
SizeAmount of data elements (u8 or u16) to be received.
Return values
HALstatus

Definition at line 3236 of file stm32f4xx_hal_uart.c.

References __HAL_UART_ENABLE_IT, __UART_HandleTypeDef::ErrorCode, HAL_OK, HAL_UART_ERROR_NONE, HAL_UART_STATE_BUSY_RX, __UART_HandleTypeDef::Init, UART_InitTypeDef::Parity, __UART_HandleTypeDef::pRxBuffPtr, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferCount, __UART_HandleTypeDef::RxXferSize, UART_IT_ERR, UART_IT_PE, UART_IT_RXNE, and UART_PARITY_NONE.

Referenced by HAL_UART_Receive_IT(), and HAL_UARTEx_ReceiveToIdle_IT().

◆ UART_Start_Receive_DMA()

HAL_StatusTypeDef UART_Start_Receive_DMA ( UART_HandleTypeDef * huart,
uint8_t * pData,
uint16_t Size )

#include <stm32f4xx_hal_uart.h>

Start Receive operation in DMA mode.

Note
This function could be called by all HAL UART API providing reception in DMA mode.
When calling this function, parameters validity is considered as already checked, i.e. Rx State, buffer address, ... UART Handle is assumed as Locked.
Parameters
huartUART handle.
pDataPointer to data buffer (u8 or u16 data elements).
SizeAmount of data elements (u8 or u16) to be received.
Return values
HALstatus

Definition at line 3271 of file stm32f4xx_hal_uart.c.

References __HAL_UART_CLEAR_OREFLAG, __UART_HandleTypeDef::ErrorCode, HAL_DMA_Start_IT(), HAL_OK, HAL_UART_ERROR_NONE, HAL_UART_STATE_BUSY_RX, __UART_HandleTypeDef::hdmarx, __UART_HandleTypeDef::Init, __UART_HandleTypeDef::Instance, UART_InitTypeDef::Parity, __UART_HandleTypeDef::pRxBuffPtr, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferSize, UART_DMAError(), UART_DMAReceiveCplt(), UART_DMARxHalfCplt(), UART_PARITY_NONE, __DMA_HandleTypeDef::XferAbortCallback, __DMA_HandleTypeDef::XferCpltCallback, __DMA_HandleTypeDef::XferErrorCallback, and __DMA_HandleTypeDef::XferHalfCpltCallback.

Referenced by HAL_UART_Receive_DMA(), and HAL_UARTEx_ReceiveToIdle_DMA().

◆ UART_EndTxTransfer()

static void UART_EndTxTransfer ( UART_HandleTypeDef * huart)
static

#include <stm32f4xx_hal_uart.c>

End ongoing Tx transfer on UART peripheral (following error detection or Transmit completion).

Parameters
huartUART handle.
Return values
None

Definition at line 3321 of file stm32f4xx_hal_uart.c.

References __UART_HandleTypeDef::gState, HAL_UART_STATE_READY, and __UART_HandleTypeDef::Instance.

Referenced by HAL_UART_DMAStop(), and UART_DMAError().

◆ UART_EndRxTransfer()

static void UART_EndRxTransfer ( UART_HandleTypeDef * huart)
static

#include <stm32f4xx_hal_uart.c>

End ongoing Rx transfer on UART peripheral (following error detection or Reception completion).

Parameters
huartUART handle.
Return values
None

Definition at line 3335 of file stm32f4xx_hal_uart.c.

References HAL_UART_RECEPTION_STANDARD, HAL_UART_RECEPTION_TOIDLE, HAL_UART_STATE_READY, __UART_HandleTypeDef::Instance, __UART_HandleTypeDef::ReceptionType, and __UART_HandleTypeDef::RxState.

Referenced by HAL_UART_DMAStop(), HAL_UART_IRQHandler(), UART_DMAError(), and UART_WaitOnFlagUntilTimeout().

◆ UART_DMATransmitCplt()

static void UART_DMATransmitCplt ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

Initialize the callbacks to their default values.

Parameters
huartUART handle.
Return values
none

DMA UART transmit process complete callback.

Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 2988 of file stm32f4xx_hal_uart.c.

References HAL_UART_TxCpltCallback(), __DMA_HandleTypeDef::Instance, __UART_HandleTypeDef::Instance, and __UART_HandleTypeDef::TxXferCount.

Referenced by HAL_UART_Transmit_DMA().

◆ UART_DMAReceiveCplt()

static void UART_DMAReceiveCplt ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART receive process complete callback.

Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3042 of file stm32f4xx_hal_uart.c.

References HAL_UART_RECEPTION_TOIDLE, HAL_UART_RxCpltCallback(), HAL_UART_RXEVENT_TC, HAL_UART_STATE_READY, HAL_UARTEx_RxEventCallback(), __DMA_HandleTypeDef::Instance, __UART_HandleTypeDef::Instance, __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxEventType, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferCount, and __UART_HandleTypeDef::RxXferSize.

Referenced by UART_Start_Receive_DMA().

◆ UART_DMATxHalfCplt()

static void UART_DMATxHalfCplt ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART transmit process half complete callback.

Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3023 of file stm32f4xx_hal_uart.c.

References HAL_UART_TxHalfCpltCallback().

Referenced by HAL_UART_Transmit_DMA().

◆ UART_DMARxHalfCplt()

static void UART_DMARxHalfCplt ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART receive process half complete callback.

Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3104 of file stm32f4xx_hal_uart.c.

References HAL_UART_RECEPTION_TOIDLE, HAL_UART_RXEVENT_HT, HAL_UART_RxHalfCpltCallback(), HAL_UARTEx_RxEventCallback(), __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxEventType, and __UART_HandleTypeDef::RxXferSize.

Referenced by UART_Start_Receive_DMA().

◆ UART_DMAError()

static void UART_DMAError ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART communication error callback.

Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3143 of file stm32f4xx_hal_uart.c.

References __UART_HandleTypeDef::ErrorCode, __UART_HandleTypeDef::gState, HAL_IS_BIT_SET, HAL_UART_ERROR_DMA, HAL_UART_ErrorCallback(), HAL_UART_STATE_BUSY_RX, HAL_UART_STATE_BUSY_TX, __UART_HandleTypeDef::Instance, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferCount, __UART_HandleTypeDef::TxXferCount, UART_EndRxTransfer(), and UART_EndTxTransfer().

Referenced by HAL_UART_Transmit_DMA(), and UART_Start_Receive_DMA().

◆ UART_DMAAbortOnError()

static void UART_DMAAbortOnError ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART communication abort callback, when initiated by HAL services on Error (To be called at end of DMA Abort procedure following error occurrence).

Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3359 of file stm32f4xx_hal_uart.c.

References HAL_UART_ErrorCallback(), __UART_HandleTypeDef::RxXferCount, and __UART_HandleTypeDef::TxXferCount.

Referenced by HAL_UART_IRQHandler().

◆ UART_DMATxAbortCallback()

static void UART_DMATxAbortCallback ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART Tx communication abort callback, when initiated by user (To be called at end of DMA Tx Abort procedure following user abort request).

Note
When this callback is executed, User Abort complete call back is called only if no Abort still ongoing for Rx DMA Handle.
Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3383 of file stm32f4xx_hal_uart.c.

References __UART_HandleTypeDef::ErrorCode, __UART_HandleTypeDef::gState, HAL_UART_AbortCpltCallback(), HAL_UART_ERROR_NONE, HAL_UART_RECEPTION_STANDARD, HAL_UART_STATE_READY, __UART_HandleTypeDef::hdmarx, __UART_HandleTypeDef::hdmatx, __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferCount, __UART_HandleTypeDef::TxXferCount, and __DMA_HandleTypeDef::XferAbortCallback.

Referenced by HAL_UART_Abort_IT().

◆ UART_DMARxAbortCallback()

static void UART_DMARxAbortCallback ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART Rx communication abort callback, when initiated by user (To be called at end of DMA Rx Abort procedure following user abort request).

Note
When this callback is executed, User Abort complete call back is called only if no Abort still ongoing for Tx DMA Handle.
Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3429 of file stm32f4xx_hal_uart.c.

References __UART_HandleTypeDef::ErrorCode, __UART_HandleTypeDef::gState, HAL_UART_AbortCpltCallback(), HAL_UART_ERROR_NONE, HAL_UART_RECEPTION_STANDARD, HAL_UART_STATE_READY, __UART_HandleTypeDef::hdmarx, __UART_HandleTypeDef::hdmatx, __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferCount, __UART_HandleTypeDef::TxXferCount, and __DMA_HandleTypeDef::XferAbortCallback.

Referenced by HAL_UART_Abort_IT().

◆ UART_DMATxOnlyAbortCallback()

static void UART_DMATxOnlyAbortCallback ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART Tx communication abort callback, when initiated by user by a call to HAL_UART_AbortTransmit_IT API (Abort only Tx transfer) (This callback is executed at end of DMA Tx Abort procedure following user abort request, and leads to user Tx Abort Complete callback execution).

Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3475 of file stm32f4xx_hal_uart.c.

References __UART_HandleTypeDef::gState, HAL_UART_AbortTransmitCpltCallback(), HAL_UART_STATE_READY, and __UART_HandleTypeDef::TxXferCount.

Referenced by HAL_UART_AbortTransmit_IT().

◆ UART_DMARxOnlyAbortCallback()

static void UART_DMARxOnlyAbortCallback ( DMA_HandleTypeDef * hdma)
static

#include <stm32f4xx_hal_uart.c>

DMA UART Rx communication abort callback, when initiated by user by a call to HAL_UART_AbortReceive_IT API (Abort only Rx transfer) (This callback is executed at end of DMA Rx Abort procedure following user abort request, and leads to user Rx Abort Complete callback execution).

Parameters
hdmaPointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module.
Return values
None

Definition at line 3503 of file stm32f4xx_hal_uart.c.

References HAL_UART_AbortReceiveCpltCallback(), HAL_UART_RECEPTION_STANDARD, HAL_UART_STATE_READY, __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxState, and __UART_HandleTypeDef::RxXferCount.

Referenced by HAL_UART_AbortReceive_IT().

◆ UART_Transmit_IT()

static HAL_StatusTypeDef UART_Transmit_IT ( UART_HandleTypeDef * huart)
static

#include <stm32f4xx_hal_uart.c>

Sends an amount of data in non blocking mode.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
Return values
HALstatus

Definition at line 3529 of file stm32f4xx_hal_uart.c.

References __HAL_UART_DISABLE_IT, __HAL_UART_ENABLE_IT, __UART_HandleTypeDef::gState, HAL_BUSY, HAL_OK, HAL_UART_STATE_BUSY_TX, __UART_HandleTypeDef::Init, __UART_HandleTypeDef::Instance, UART_InitTypeDef::Parity, __UART_HandleTypeDef::pTxBuffPtr, __UART_HandleTypeDef::TxXferCount, UART_IT_TC, UART_IT_TXE, UART_PARITY_NONE, UART_WORDLENGTH_9B, and UART_InitTypeDef::WordLength.

Referenced by HAL_UART_IRQHandler().

◆ UART_EndTransmit_IT()

static HAL_StatusTypeDef UART_EndTransmit_IT ( UART_HandleTypeDef * huart)
static

#include <stm32f4xx_hal_uart.c>

Wraps up transmission in non blocking mode.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
Return values
HALstatus

Definition at line 3569 of file stm32f4xx_hal_uart.c.

References __HAL_UART_DISABLE_IT, __UART_HandleTypeDef::gState, HAL_OK, HAL_UART_STATE_READY, HAL_UART_TxCpltCallback(), and UART_IT_TC.

Referenced by HAL_UART_IRQHandler().

◆ UART_Receive_IT()

◆ UART_WaitOnFlagUntilTimeout()

static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout ( UART_HandleTypeDef * huart,
uint32_t Flag,
FlagStatus Status,
uint32_t Tickstart,
uint32_t Timeout )
static

#include <stm32f4xx_hal_uart.c>

This function handles UART Communication Timeout. It waits until a flag is no longer in the specified status.

Parameters
huartPointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module.
Flagspecifies the UART flag to check.
StatusThe actual Flag status (SET or RESET).
TickstartTick start value
TimeoutTimeout duration
Return values
HALstatus

Definition at line 3185 of file stm32f4xx_hal_uart.c.

References __HAL_UART_CLEAR_OREFLAG, __HAL_UART_GET_FLAG, __HAL_UNLOCK, __UART_HandleTypeDef::ErrorCode, HAL_ERROR, HAL_GetTick(), HAL_MAX_DELAY, HAL_OK, HAL_TIMEOUT, HAL_UART_ERROR_ORE, __UART_HandleTypeDef::Instance, UART_EndRxTransfer(), UART_FLAG_ORE, UART_FLAG_TC, and UART_FLAG_TXE.

Referenced by HAL_UART_Receive(), and HAL_UART_Transmit().

◆ UART_SetConfig()