STM32F103xB HAL User Manual
|
Functions | |
void | UART_InitCallbacksToDefault (UART_HandleTypeDef *huart) |
Initialize the callbacks to their default values. | |
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) |
DMA UART transmit process complete callback. | |
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. | |
static void | UART_SetConfig (UART_HandleTypeDef *huart) |
Configures the UART peripheral. | |
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_DMAAbortOnError | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
DMA UART communication abort callback, when initiated by HAL services on Error (To be called at end of DMA Abort procedure following error occurrence).
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3328 of file stm32f1xx_hal_uart.c.
References __UART_HandleTypeDef::ErrorCallback, HAL_UART_ErrorCallback(), __TIM_HandleTypeDef::hdma, __UART_HandleTypeDef::RxXferCount, and __UART_HandleTypeDef::TxXferCount.
Referenced by HAL_UART_IRQHandler().
static void UART_DMAError | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
DMA UART communication error callback.
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3126 of file stm32f1xx_hal_uart.c.
References __UART_HandleTypeDef::ErrorCallback, __UART_HandleTypeDef::ErrorCode, __UART_HandleTypeDef::gState, HAL_UART_ERROR_DMA, HAL_UART_ErrorCallback(), HAL_UART_STATE_BUSY_RX, HAL_UART_STATE_BUSY_TX, __TIM_HandleTypeDef::hdma, __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().
static void UART_DMAReceiveCplt | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
DMA UART receive process complete callback.
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3034 of file stm32f1xx_hal_uart.c.
References HAL_UART_RECEPTION_TOIDLE, HAL_UART_RxCpltCallback(), HAL_UART_STATE_READY, HAL_UARTEx_RxEventCallback(), __TIM_HandleTypeDef::hdma, __DMA_HandleTypeDef::Instance, __UART_HandleTypeDef::Instance, __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxCpltCallback, __UART_HandleTypeDef::RxEventCallback, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferCount, and __UART_HandleTypeDef::RxXferSize.
Referenced by UART_Start_Receive_DMA().
static void UART_DMARxAbortCallback | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
DMA UART Rx communication abort callback, when initiated by user (To be called at end of DMA Rx Abort procedure following user abort request).
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3398 of file stm32f1xx_hal_uart.c.
References __UART_HandleTypeDef::AbortCpltCallback, __UART_HandleTypeDef::ErrorCode, __UART_HandleTypeDef::gState, HAL_UART_AbortCpltCallback(), HAL_UART_ERROR_NONE, HAL_UART_RECEPTION_STANDARD, HAL_UART_STATE_READY, __TIM_HandleTypeDef::hdma, __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().
static void UART_DMARxHalfCplt | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
DMA UART receive process half complete callback.
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3091 of file stm32f1xx_hal_uart.c.
References HAL_UART_RECEPTION_TOIDLE, HAL_UART_RxHalfCpltCallback(), HAL_UARTEx_RxEventCallback(), __TIM_HandleTypeDef::hdma, __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxEventCallback, __UART_HandleTypeDef::RxHalfCpltCallback, and __UART_HandleTypeDef::RxXferSize.
Referenced by UART_Start_Receive_DMA().
static void UART_DMARxOnlyAbortCallback | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
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).
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3472 of file stm32f1xx_hal_uart.c.
References __UART_HandleTypeDef::AbortReceiveCpltCallback, HAL_UART_AbortReceiveCpltCallback(), HAL_UART_RECEPTION_STANDARD, HAL_UART_STATE_READY, __TIM_HandleTypeDef::hdma, __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxState, and __UART_HandleTypeDef::RxXferCount.
Referenced by HAL_UART_AbortReceive_IT().
static void UART_DMATransmitCplt | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
DMA UART transmit process complete callback.
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 2980 of file stm32f1xx_hal_uart.c.
References HAL_UART_TxCpltCallback(), __TIM_HandleTypeDef::hdma, __DMA_HandleTypeDef::Instance, __UART_HandleTypeDef::Instance, __UART_HandleTypeDef::TxCpltCallback, and __UART_HandleTypeDef::TxXferCount.
Referenced by HAL_UART_Transmit_DMA().
static void UART_DMATxAbortCallback | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
DMA UART Tx communication abort callback, when initiated by user (To be called at end of DMA Tx Abort procedure following user abort request).
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3352 of file stm32f1xx_hal_uart.c.
References __UART_HandleTypeDef::AbortCpltCallback, __UART_HandleTypeDef::ErrorCode, __UART_HandleTypeDef::gState, HAL_UART_AbortCpltCallback(), HAL_UART_ERROR_NONE, HAL_UART_RECEPTION_STANDARD, HAL_UART_STATE_READY, __TIM_HandleTypeDef::hdma, __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().
static void UART_DMATxHalfCplt | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
DMA UART transmit process half complete callback.
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3015 of file stm32f1xx_hal_uart.c.
References HAL_UART_TxHalfCpltCallback(), __TIM_HandleTypeDef::hdma, and __UART_HandleTypeDef::TxHalfCpltCallback.
Referenced by HAL_UART_Transmit_DMA().
static void UART_DMATxOnlyAbortCallback | ( | DMA_HandleTypeDef * | hdma | ) | [static] |
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).
hdma | Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA module. |
None |
Definition at line 3444 of file stm32f1xx_hal_uart.c.
References __UART_HandleTypeDef::AbortTransmitCpltCallback, __UART_HandleTypeDef::gState, HAL_UART_AbortTransmitCpltCallback(), HAL_UART_STATE_READY, __TIM_HandleTypeDef::hdma, and __UART_HandleTypeDef::TxXferCount.
Referenced by HAL_UART_AbortTransmit_IT().
static void UART_EndRxTransfer | ( | UART_HandleTypeDef * | huart | ) | [static] |
End ongoing Rx transfer on UART peripheral (following error detection or Reception completion).
huart | UART handle. |
None |
Definition at line 3304 of file stm32f1xx_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(), and UART_DMAError().
static HAL_StatusTypeDef UART_EndTransmit_IT | ( | UART_HandleTypeDef * | huart | ) | [static] |
Wraps up transmission in non blocking mode.
huart | Pointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module. |
HAL | status |
Definition at line 3538 of file stm32f1xx_hal_uart.c.
References __HAL_UART_DISABLE_IT, __UART_HandleTypeDef::gState, HAL_UART_STATE_READY, HAL_UART_TxCpltCallback(), __UART_HandleTypeDef::TxCpltCallback, and UART_IT_TC.
Referenced by HAL_UART_IRQHandler().
static void UART_EndTxTransfer | ( | UART_HandleTypeDef * | huart | ) | [static] |
End ongoing Tx transfer on UART peripheral (following error detection or Transmit completion).
huart | UART handle. |
None |
Definition at line 3290 of file stm32f1xx_hal_uart.c.
References __UART_HandleTypeDef::gState, HAL_UART_STATE_READY, and __UART_HandleTypeDef::Instance.
Referenced by HAL_UART_DMAStop(), and UART_DMAError().
void UART_InitCallbacksToDefault | ( | UART_HandleTypeDef * | huart | ) |
Initialize the callbacks to their default values.
huart | UART handle. |
none |
Definition at line 2958 of file stm32f1xx_hal_uart.c.
References __UART_HandleTypeDef::AbortCpltCallback, __UART_HandleTypeDef::AbortReceiveCpltCallback, __UART_HandleTypeDef::AbortTransmitCpltCallback, __UART_HandleTypeDef::ErrorCallback, HAL_UART_AbortCpltCallback(), HAL_UART_AbortReceiveCpltCallback(), HAL_UART_AbortTransmitCpltCallback(), HAL_UART_ErrorCallback(), HAL_UART_RxCpltCallback(), HAL_UART_RxHalfCpltCallback(), HAL_UART_TxCpltCallback(), HAL_UART_TxHalfCpltCallback(), HAL_UARTEx_RxEventCallback(), __UART_HandleTypeDef::RxCpltCallback, __UART_HandleTypeDef::RxEventCallback, __UART_HandleTypeDef::RxHalfCpltCallback, __UART_HandleTypeDef::TxCpltCallback, and __UART_HandleTypeDef::TxHalfCpltCallback.
Referenced by HAL_HalfDuplex_Init(), HAL_LIN_Init(), HAL_MultiProcessor_Init(), and HAL_UART_Init().
static HAL_StatusTypeDef UART_Receive_IT | ( | UART_HandleTypeDef * | huart | ) | [static] |
Receives an amount of data in non blocking mode.
huart | Pointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module. |
HAL | status |
Definition at line 3563 of file stm32f1xx_hal_uart.c.
References __HAL_UART_DISABLE_IT, HAL_UART_RECEPTION_STANDARD, HAL_UART_RECEPTION_TOIDLE, HAL_UART_RxCpltCallback(), HAL_UART_STATE_BUSY_RX, HAL_UART_STATE_READY, HAL_UARTEx_RxEventCallback(), __UART_HandleTypeDef::Init, __UART_HandleTypeDef::Instance, UART_InitTypeDef::Parity, __UART_HandleTypeDef::pRxBuffPtr, __UART_HandleTypeDef::ReceptionType, __UART_HandleTypeDef::RxCpltCallback, __UART_HandleTypeDef::RxEventCallback, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferCount, __UART_HandleTypeDef::RxXferSize, UART_IT_ERR, UART_IT_PE, UART_IT_RXNE, UART_PARITY_NONE, UART_WORDLENGTH_8B, UART_WORDLENGTH_9B, and UART_InitTypeDef::WordLength.
Referenced by HAL_UART_IRQHandler().
static void UART_SetConfig | ( | UART_HandleTypeDef * | huart | ) | [static] |
Configures the UART peripheral.
huart | Pointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module. |
None |
Definition at line 3651 of file stm32f1xx_hal_uart.c.
References assert_param, UART_InitTypeDef::BaudRate, HAL_RCC_GetPCLK1Freq(), HAL_RCC_GetPCLK2Freq(), UART_InitTypeDef::HwFlowCtl, __UART_HandleTypeDef::Init, __UART_HandleTypeDef::Instance, IS_UART_BAUDRATE, IS_UART_MODE, IS_UART_PARITY, IS_UART_STOPBITS, UART_InitTypeDef::Mode, UART_InitTypeDef::OverSampling, UART_InitTypeDef::Parity, UART_InitTypeDef::StopBits, UART_BRR_SAMPLING16, UART_BRR_SAMPLING8, and UART_InitTypeDef::WordLength.
Referenced by HAL_HalfDuplex_Init(), HAL_LIN_Init(), HAL_MultiProcessor_Init(), and HAL_UART_Init().
HAL_StatusTypeDef UART_Start_Receive_DMA | ( | UART_HandleTypeDef * | huart, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Start Receive operation in DMA mode.
huart | UART handle. |
pData | Pointer to data buffer (u8 or u16 data elements). |
Size | Amount of data elements (u8 or u16) to be received. |
HAL | status |
Definition at line 3240 of file stm32f1xx_hal_uart.c.
References __HAL_UART_CLEAR_OREFLAG, __UART_HandleTypeDef::ErrorCode, HAL_DMA_Start_IT(), HAL_UART_ERROR_NONE, HAL_UART_STATE_BUSY_RX, __UART_HandleTypeDef::hdmarx, __UART_HandleTypeDef::Instance, __UART_HandleTypeDef::pRxBuffPtr, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferSize, UART_DMAError(), UART_DMAReceiveCplt(), UART_DMARxHalfCplt(), __DMA_HandleTypeDef::XferAbortCallback, __DMA_HandleTypeDef::XferCpltCallback, __DMA_HandleTypeDef::XferErrorCallback, and __DMA_HandleTypeDef::XferHalfCpltCallback.
Referenced by HAL_UART_Receive_DMA(), and HAL_UARTEx_ReceiveToIdle_DMA().
HAL_StatusTypeDef UART_Start_Receive_IT | ( | UART_HandleTypeDef * | huart, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Start Receive operation in interrupt mode.
huart | UART handle. |
pData | Pointer to data buffer (u8 or u16 data elements). |
Size | Amount of data elements (u8 or u16) to be received. |
HAL | status |
Definition at line 3205 of file stm32f1xx_hal_uart.c.
References __HAL_UART_ENABLE_IT, __UART_HandleTypeDef::ErrorCode, HAL_UART_ERROR_NONE, HAL_UART_STATE_BUSY_RX, __UART_HandleTypeDef::pRxBuffPtr, __UART_HandleTypeDef::RxState, __UART_HandleTypeDef::RxXferCount, __UART_HandleTypeDef::RxXferSize, UART_IT_ERR, UART_IT_PE, and UART_IT_RXNE.
Referenced by HAL_UART_Receive_IT(), and HAL_UARTEx_ReceiveToIdle_IT().
static HAL_StatusTypeDef UART_Transmit_IT | ( | UART_HandleTypeDef * | huart | ) | [static] |
Sends an amount of data in non blocking mode.
huart | Pointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module. |
HAL | status |
Definition at line 3498 of file stm32f1xx_hal_uart.c.
References __HAL_UART_DISABLE_IT, __HAL_UART_ENABLE_IT, __UART_HandleTypeDef::gState, 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().
static HAL_StatusTypeDef UART_WaitOnFlagUntilTimeout | ( | UART_HandleTypeDef * | huart, |
uint32_t | Flag, | ||
FlagStatus | Status, | ||
uint32_t | Tickstart, | ||
uint32_t | Timeout | ||
) | [static] |
This function handles UART Communication Timeout.
huart | Pointer to a UART_HandleTypeDef structure that contains the configuration information for the specified UART module. |
Flag | specifies the UART flag to check. |
Status | The new Flag status (SET or RESET). |
Tickstart | Tick start value |
Timeout | Timeout duration |
HAL | status |
Definition at line 3167 of file stm32f1xx_hal_uart.c.
References __HAL_UART_GET_FLAG, __UART_HandleTypeDef::gState, HAL_GetTick(), HAL_UART_STATE_READY, __UART_HandleTypeDef::Instance, and __UART_HandleTypeDef::RxState.
Referenced by HAL_UART_Receive(), and HAL_UART_Transmit().