Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of TUKS-COURSE-TIMER by
IO operation functions
[UART Exported Functions]
UART Transmit/Receive functions. More...
Functions | |
HAL_StatusTypeDef | HAL_UART_Transmit (UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
Send an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_UART_Receive (UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
Receive an amount of data in blocking mode. | |
HAL_StatusTypeDef | HAL_UART_Transmit_IT (UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) |
Send an amount of data in interrupt mode. | |
HAL_StatusTypeDef | HAL_UART_Receive_IT (UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) |
Receive an amount of data in interrupt mode. | |
HAL_StatusTypeDef | HAL_UART_Transmit_DMA (UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) |
Send an amount of data in DMA mode. | |
HAL_StatusTypeDef | HAL_UART_Receive_DMA (UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size) |
Receive an amount of data in DMA mode. | |
HAL_StatusTypeDef | HAL_UART_DMAPause (UART_HandleTypeDef *huart) |
Pause the DMA Transfer. | |
HAL_StatusTypeDef | HAL_UART_DMAResume (UART_HandleTypeDef *huart) |
Resume the DMA Transfer. | |
HAL_StatusTypeDef | HAL_UART_DMAStop (UART_HandleTypeDef *huart) |
Stop the DMA Transfer. | |
void | HAL_UART_IRQHandler (UART_HandleTypeDef *huart) |
Handle UART interrupt request. | |
__weak void | HAL_UART_TxCpltCallback (UART_HandleTypeDef *huart) |
Tx Transfer completed callback. | |
__weak void | HAL_UART_TxHalfCpltCallback (UART_HandleTypeDef *huart) |
Tx Half Transfer completed callback. | |
__weak void | HAL_UART_RxCpltCallback (UART_HandleTypeDef *huart) |
Rx Transfer completed callback. | |
__weak void | HAL_UART_RxHalfCpltCallback (UART_HandleTypeDef *huart) |
Rx Half Transfer completed callback. | |
__weak void | HAL_UART_ErrorCallback (UART_HandleTypeDef *huart) |
UART error callback. |
Detailed Description
UART Transmit/Receive functions.
=============================================================================== ##### IO operation functions ##### =============================================================================== This subsection provides a set of functions allowing to manage the UART asynchronous and Half duplex data transfers. (#) There are two mode of transfer: (+) Blocking mode: The communication is performed in polling mode. The HAL status of all data processing is returned by the same function after finishing transfer. (+) No-Blocking mode: The communication is performed using Interrupts or DMA, These API's return the HAL status. The end of the data processing will be indicated through the dedicated UART IRQ when using Interrupt mode or the DMA IRQ when using DMA mode. The HAL_UART_TxCpltCallback(), HAL_UART_RxCpltCallback() user callbacks will be executed respectively at the end of the transmit or Receive process The HAL_UART_ErrorCallback()user callback will be executed when a communication error is detected (#) Blocking mode API's are : (+) HAL_UART_Transmit() (+) HAL_UART_Receive() (#) Non-Blocking mode API's with Interrupt are : (+) HAL_UART_Transmit_IT() (+) HAL_UART_Receive_IT() (+) HAL_UART_IRQHandler() (#) No-Blocking mode API's with DMA are : (+) HAL_UART_Transmit_DMA() (+) HAL_UART_Receive_DMA() (+) HAL_UART_DMAPause() (+) HAL_UART_DMAResume() (+) HAL_UART_DMAStop() (#) A set of Transfer Complete Callbacks are provided in No_Blocking mode: (+) HAL_UART_TxHalfCpltCallback() (+) HAL_UART_TxCpltCallback() (+) HAL_UART_RxHalfCpltCallback() (+) HAL_UART_RxCpltCallback() (+) HAL_UART_ErrorCallback() (#) In Non-Blocking mode transfers, possible errors are split into 2 categories. Errors are handled as follows : (+) Error is considered as Recoverable and non blocking : Transfer could go till end, but error severity is to be evaluated by user : this concerns Frame Error, Parity Error or Noise Error in Interrupt mode reception . Received character is then retrieved and stored in Rx buffer, Error code is set to allow user to identify error type, and HAL_UART_ErrorCallback() user callback is executed. Transfer is kept ongoing on UART side. (+) Error is considered as Blocking : Transfer could not be completed properly and is aborted. This concerns Overrun Error In Interrupt mode reception and all errors in DMA mode. Error code is set to allow user to identify error type, and HAL_UART_ErrorCallback() user callback is executed. -@- In the Half duplex communication, it is forbidden to run the transmit and receive process in parallel, the UART state HAL_UART_STATE_BUSY_TX_RX can't be useful.
Function Documentation
HAL_StatusTypeDef HAL_UART_DMAPause | ( | UART_HandleTypeDef * | huart ) |
Pause the DMA Transfer.
- Parameters:
-
huart,: UART handle.
- Return values:
-
HAL status
Definition at line 997 of file stm32l4xx_hal_uart.c.
HAL_StatusTypeDef HAL_UART_DMAResume | ( | UART_HandleTypeDef * | huart ) |
Resume the DMA Transfer.
- Parameters:
-
huart,: UART handle.
- Return values:
-
HAL status
Definition at line 1030 of file stm32l4xx_hal_uart.c.
HAL_StatusTypeDef HAL_UART_DMAStop | ( | UART_HandleTypeDef * | huart ) |
Stop the DMA Transfer.
- Parameters:
-
huart,: UART handle.
- Return values:
-
HAL status
Definition at line 1064 of file stm32l4xx_hal_uart.c.
__weak void HAL_UART_ErrorCallback | ( | UART_HandleTypeDef * | huart ) |
UART error callback.
- Parameters:
-
huart,: UART handle.
- Return values:
-
None
Definition at line 1322 of file stm32l4xx_hal_uart.c.
void HAL_UART_IRQHandler | ( | UART_HandleTypeDef * | huart ) |
Handle UART interrupt request.
- Parameters:
-
huart,: UART handle.
- Return values:
-
None
Definition at line 1111 of file stm32l4xx_hal_uart.c.
HAL_StatusTypeDef HAL_UART_Receive | ( | UART_HandleTypeDef * | huart, |
uint8_t * | pData, | ||
uint16_t | Size, | ||
uint32_t | Timeout | ||
) |
Receive an amount of data in blocking mode.
- Parameters:
-
huart,: UART handle. pData,: pointer to data buffer. Size,: amount of data to be received. Timeout,: Timeout duration.
- Return values:
-
HAL status
Definition at line 707 of file stm32l4xx_hal_uart.c.
HAL_StatusTypeDef HAL_UART_Receive_DMA | ( | UART_HandleTypeDef * | huart, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Receive an amount of data in DMA mode.
- Parameters:
-
huart,: UART handle. pData,: pointer to data buffer. Size,: amount of data to be received.
- Note:
- When the UART parity is enabled (PCE = 1), the received data contain the parity bit (MSB position).
- Return values:
-
HAL status
Definition at line 934 of file stm32l4xx_hal_uart.c.
HAL_StatusTypeDef HAL_UART_Receive_IT | ( | UART_HandleTypeDef * | huart, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Receive an amount of data in interrupt mode.
- Parameters:
-
huart,: UART handle. pData,: pointer to data buffer. Size,: amount of data to be received.
- Return values:
-
HAL status
Definition at line 819 of file stm32l4xx_hal_uart.c.
__weak void HAL_UART_RxCpltCallback | ( | UART_HandleTypeDef * | huart ) |
Rx Transfer completed callback.
- Parameters:
-
huart,: UART handle.
- Return values:
-
None
Definition at line 1292 of file stm32l4xx_hal_uart.c.
__weak void HAL_UART_RxHalfCpltCallback | ( | UART_HandleTypeDef * | huart ) |
Rx Half Transfer completed callback.
- Parameters:
-
huart,: UART handle.
- Return values:
-
None
Definition at line 1307 of file stm32l4xx_hal_uart.c.
HAL_StatusTypeDef HAL_UART_Transmit | ( | UART_HandleTypeDef * | huart, |
uint8_t * | pData, | ||
uint16_t | Size, | ||
uint32_t | Timeout | ||
) |
Send an amount of data in blocking mode.
- Parameters:
-
huart,: UART handle. pData,: Pointer to data buffer. Size,: Amount of data to be sent. Timeout,: Timeout duration.
- Return values:
-
HAL status
Definition at line 638 of file stm32l4xx_hal_uart.c.
HAL_StatusTypeDef HAL_UART_Transmit_DMA | ( | UART_HandleTypeDef * | huart, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Send an amount of data in DMA mode.
- Parameters:
-
huart,: UART handle. pData,: pointer to data buffer. Size,: amount of data to be sent.
- Return values:
-
HAL status
Definition at line 869 of file stm32l4xx_hal_uart.c.
HAL_StatusTypeDef HAL_UART_Transmit_IT | ( | UART_HandleTypeDef * | huart, |
uint8_t * | pData, | ||
uint16_t | Size | ||
) |
Send an amount of data in interrupt mode.
- Parameters:
-
huart,: UART handle. pData,: pointer to data buffer. Size,: amount of data to be sent.
- Return values:
-
HAL status
Definition at line 778 of file stm32l4xx_hal_uart.c.
__weak void HAL_UART_TxCpltCallback | ( | UART_HandleTypeDef * | huart ) |
Tx Transfer completed callback.
- Parameters:
-
huart,: UART handle.
- Return values:
-
None
Definition at line 1262 of file stm32l4xx_hal_uart.c.
__weak void HAL_UART_TxHalfCpltCallback | ( | UART_HandleTypeDef * | huart ) |
Tx Half Transfer completed callback.
- Parameters:
-
huart,: UART handle.
- Return values:
-
None
Definition at line 1277 of file stm32l4xx_hal_uart.c.
Generated on Tue Jul 12 2022 17:38:54 by
