|
STM32L4xx_HAL_Driver
1.14.0
|
USART Transmit and Receive functions. More...
Functions | |
| HAL_StatusTypeDef | HAL_USART_Transmit (USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size, uint32_t Timeout) |
| Simplex send an amount of data in blocking mode. More... | |
| HAL_StatusTypeDef | HAL_USART_Receive (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size, uint32_t Timeout) |
| Receive an amount of data in blocking mode. More... | |
| HAL_StatusTypeDef | HAL_USART_TransmitReceive (USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout) |
| Full-Duplex Send and Receive an amount of data in blocking mode. More... | |
| HAL_StatusTypeDef | HAL_USART_Transmit_IT (USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size) |
| Send an amount of data in interrupt mode. More... | |
| HAL_StatusTypeDef | HAL_USART_Receive_IT (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size) |
| Receive an amount of data in interrupt mode. More... | |
| HAL_StatusTypeDef | HAL_USART_TransmitReceive_IT (USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) |
| Full-Duplex Send and Receive an amount of data in interrupt mode. More... | |
| HAL_StatusTypeDef | HAL_USART_Transmit_DMA (USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size) |
| Send an amount of data in DMA mode. More... | |
| HAL_StatusTypeDef | HAL_USART_Receive_DMA (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size) |
| Receive an amount of data in DMA mode. More... | |
| HAL_StatusTypeDef | HAL_USART_TransmitReceive_DMA (USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) |
| Full-Duplex Transmit Receive an amount of data in non-blocking mode. More... | |
| HAL_StatusTypeDef | HAL_USART_DMAPause (USART_HandleTypeDef *husart) |
| Pause the DMA Transfer. More... | |
| HAL_StatusTypeDef | HAL_USART_DMAResume (USART_HandleTypeDef *husart) |
| Resume the DMA Transfer. More... | |
| HAL_StatusTypeDef | HAL_USART_DMAStop (USART_HandleTypeDef *husart) |
| Stop the DMA Transfer. More... | |
| HAL_StatusTypeDef | HAL_USART_Abort (USART_HandleTypeDef *husart) |
| Abort ongoing transfers (blocking mode). More... | |
| HAL_StatusTypeDef | HAL_USART_Abort_IT (USART_HandleTypeDef *husart) |
| Abort ongoing transfers (Interrupt mode). More... | |
| void | HAL_USART_IRQHandler (USART_HandleTypeDef *husart) |
| Handle USART interrupt request. More... | |
| void | HAL_USART_TxHalfCpltCallback (USART_HandleTypeDef *husart) |
| Tx Half Transfer completed callback. More... | |
| void | HAL_USART_TxCpltCallback (USART_HandleTypeDef *husart) |
| Tx Transfer completed callback. More... | |
| void | HAL_USART_RxCpltCallback (USART_HandleTypeDef *husart) |
| Rx Transfer completed callback. More... | |
| void | HAL_USART_RxHalfCpltCallback (USART_HandleTypeDef *husart) |
| Rx Half Transfer completed callback. More... | |
| void | HAL_USART_TxRxCpltCallback (USART_HandleTypeDef *husart) |
| Tx/Rx Transfers completed callback for the non-blocking process. More... | |
| void | HAL_USART_ErrorCallback (USART_HandleTypeDef *husart) |
| USART error callback. More... | |
| void | HAL_USART_AbortCpltCallback (USART_HandleTypeDef *husart) |
| USART Abort Complete callback. More... | |
USART Transmit and Receive functions.
===============================================================================
##### IO operation functions #####
===============================================================================
[..] This subsection provides a set of functions allowing to manage the USART synchronous
data transfers.
[..] The USART supports master mode only: it cannot receive or send data related to an input
clock (SCLK is always an output).
[..]
(#) There are two modes 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 USART IRQ when using Interrupt mode or the DMA IRQ when
using DMA mode.
The HAL_USART_TxCpltCallback(), HAL_USART_RxCpltCallback() and HAL_USART_TxRxCpltCallback() user callbacks
will be executed respectively at the end of the transmit or Receive process
The HAL_USART_ErrorCallback()user callback will be executed when a communication error is detected
(#) Blocking mode API's are :
(++) HAL_USART_Transmit() in simplex mode
(++) HAL_USART_Receive() in full duplex receive only
(++) HAL_USART_TransmitReceive() in full duplex mode
(#) Non-Blocking mode API's with Interrupt are :
(++) HAL_USART_Transmit_IT() in simplex mode
(++) HAL_USART_Receive_IT() in full duplex receive only
(++) HAL_USART_TransmitReceive_IT() in full duplex mode
(++) HAL_USART_IRQHandler()
(#) No-Blocking mode API's with DMA are :
(++) HAL_USART_Transmit_DMA() in simplex mode
(++) HAL_USART_Receive_DMA() in full duplex receive only
(++) HAL_USART_TransmitReceive_DMA() in full duplex mode
(++) HAL_USART_DMAPause()
(++) HAL_USART_DMAResume()
(++) HAL_USART_DMAStop()
(#) A set of Transfer Complete Callbacks are provided in Non_Blocking mode:
(++) HAL_USART_TxCpltCallback()
(++) HAL_USART_RxCpltCallback()
(++) HAL_USART_TxHalfCpltCallback()
(++) HAL_USART_RxHalfCpltCallback()
(++) HAL_USART_ErrorCallback()
(++) HAL_USART_TxRxCpltCallback()
(#) Non-Blocking mode transfers could be aborted using Abort API's :
(++) HAL_USART_Abort()
(++) HAL_USART_Abort_IT()
(#) For Abort services based on interrupts (HAL_USART_Abort_IT), a Abort Complete Callbacks is provided:
(++) HAL_USART_AbortCpltCallback()
(#) 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_USART_ErrorCallback() user callback is executed. Transfer is kept ongoing on USART side.
If user wants to abort it, Abort services should be called by user.
(++) 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_USART_ErrorCallback() user callback is executed. | HAL_StatusTypeDef HAL_USART_Abort | ( | USART_HandleTypeDef * | husart | ) |
Abort ongoing transfers (blocking mode).
| husart | USART handle. |
| HAL | status |
Definition at line 1879 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_Abort_IT | ( | USART_HandleTypeDef * | husart | ) |
Abort ongoing transfers (Interrupt mode).
| husart | USART handle. |
| HAL | status |
Definition at line 1982 of file stm32l4xx_hal_usart.c.
| __weak void HAL_USART_AbortCpltCallback | ( | USART_HandleTypeDef * | husart | ) |
USART Abort Complete callback.
| husart | USART handle. |
| None |
Definition at line 2475 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_DMAPause | ( | USART_HandleTypeDef * | husart | ) |
Pause the DMA Transfer.
| husart | USART handle. |
| HAL | status |
Definition at line 1728 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_DMAResume | ( | USART_HandleTypeDef * | husart | ) |
Resume the DMA Transfer.
| husart | USART handle. |
| HAL | status |
Definition at line 1775 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_DMAStop | ( | USART_HandleTypeDef * | husart | ) |
Stop the DMA Transfer.
| husart | USART handle. |
| HAL | status |
Definition at line 1819 of file stm32l4xx_hal_usart.c.
| __weak void HAL_USART_ErrorCallback | ( | USART_HandleTypeDef * | husart | ) |
USART error callback.
| husart | USART handle. |
| None |
Definition at line 2460 of file stm32l4xx_hal_usart.c.
| void HAL_USART_IRQHandler | ( | USART_HandleTypeDef * | husart | ) |
Handle USART interrupt request.
| husart | USART handle. |
| None |
Definition at line 2120 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_Receive | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pRxData, | ||
| uint16_t | Size, | ||
| uint32_t | Timeout | ||
| ) |
Receive an amount of data in blocking mode.
| husart | USART handle. |
| pRxData | Pointer to data buffer. |
| Size | Amount of data to be received. |
| Timeout | Timeout duration. |
| HAL | status |
Definition at line 852 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_Receive_DMA | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pRxData, | ||
| uint16_t | Size | ||
| ) |
Receive an amount of data in DMA mode.
| husart | USART handle. |
| pRxData | pointer to data buffer. |
| Size | amount of data to be received. |
| HAL | status |
Definition at line 1495 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_Receive_IT | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pRxData, | ||
| uint16_t | Size | ||
| ) |
Receive an amount of data in interrupt mode.
| husart | USART handle. |
| pRxData | pointer to data buffer. |
| Size | amount of data to be received. |
| HAL | status |
Definition at line 1195 of file stm32l4xx_hal_usart.c.
| __weak void HAL_USART_RxCpltCallback | ( | USART_HandleTypeDef * | husart | ) |
Rx Transfer completed callback.
| husart | USART handle. |
| None |
Definition at line 2415 of file stm32l4xx_hal_usart.c.
| __weak void HAL_USART_RxHalfCpltCallback | ( | USART_HandleTypeDef * | husart | ) |
Rx Half Transfer completed callback.
| husart | USART handle. |
| None |
Definition at line 2430 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_Transmit | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pTxData, | ||
| uint16_t | Size, | ||
| uint32_t | Timeout | ||
| ) |
Simplex send an amount of data in blocking mode.
| husart | USART handle. |
| pTxData | Pointer to data buffer. |
| Size | Amount of data to be sent. |
| Timeout | Timeout duration. |
| HAL | status |
Definition at line 758 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_Transmit_DMA | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pTxData, | ||
| uint16_t | Size | ||
| ) |
Send an amount of data in DMA mode.
| husart | USART handle. |
| pTxData | pointer to data buffer. |
| Size | amount of data to be sent. |
| HAL | status |
Definition at line 1413 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_Transmit_IT | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pTxData, | ||
| uint16_t | Size | ||
| ) |
Send an amount of data in interrupt mode.
| husart | USART handle. |
| pTxData | pointer to data buffer. |
| Size | amount of data to be sent. |
| HAL | status |
Definition at line 1113 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_TransmitReceive | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pTxData, | ||
| uint8_t * | pRxData, | ||
| uint16_t | Size, | ||
| uint32_t | Timeout | ||
| ) |
Full-Duplex Send and Receive an amount of data in blocking mode.
| husart | USART handle. |
| pTxData | pointer to TX data buffer. |
| pRxData | pointer to RX data buffer. |
| Size | amount of data to be sent (same amount to be received). |
| Timeout | Timeout duration. |
| HAL | status |
Definition at line 965 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pTxData, | ||
| uint8_t * | pRxData, | ||
| uint16_t | Size | ||
| ) |
Full-Duplex Transmit Receive an amount of data in non-blocking mode.
| husart | USART handle. |
| pTxData | pointer to TX data buffer. |
| pRxData | pointer to RX data buffer. |
| Size | amount of data to be received/sent. |
| HAL | status |
Definition at line 1611 of file stm32l4xx_hal_usart.c.
| HAL_StatusTypeDef HAL_USART_TransmitReceive_IT | ( | USART_HandleTypeDef * | husart, |
| uint8_t * | pTxData, | ||
| uint8_t * | pRxData, | ||
| uint16_t | Size | ||
| ) |
Full-Duplex Send and Receive an amount of data in interrupt mode.
| husart | USART handle. |
| pTxData | pointer to TX data buffer. |
| pRxData | pointer to RX data buffer. |
| Size | amount of data to be sent (same amount to be received). |
| HAL | status |
Definition at line 1308 of file stm32l4xx_hal_usart.c.
| __weak void HAL_USART_TxCpltCallback | ( | USART_HandleTypeDef * | husart | ) |
Tx Transfer completed callback.
| husart | USART handle. |
| None |
Definition at line 2385 of file stm32l4xx_hal_usart.c.
| __weak void HAL_USART_TxHalfCpltCallback | ( | USART_HandleTypeDef * | husart | ) |
Tx Half Transfer completed callback.
| husart | USART handle. |
| None |
Definition at line 2400 of file stm32l4xx_hal_usart.c.
| __weak void HAL_USART_TxRxCpltCallback | ( | USART_HandleTypeDef * | husart | ) |
Tx/Rx Transfers completed callback for the non-blocking process.
| husart | USART handle. |
| None |
Definition at line 2445 of file stm32l4xx_hal_usart.c.