|
STM32L4xx_HAL_Driver
1.14.0
|
SMARTCARD Transmit and Receive functions. More...
Functions | |
| HAL_StatusTypeDef | HAL_SMARTCARD_Transmit (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
| Send an amount of data in blocking mode. More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_Receive (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size, uint32_t Timeout) |
| Receive an amount of data in blocking mode. More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_Transmit_IT (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size) |
| Send an amount of data in interrupt mode. More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_Receive_IT (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size) |
| Receive an amount of data in interrupt mode. More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_Transmit_DMA (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size) |
| Send an amount of data in DMA mode. More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_Receive_DMA (SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size) |
| Receive an amount of data in DMA mode. More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_Abort (SMARTCARD_HandleTypeDef *hsmartcard) |
| Abort ongoing transfers (blocking mode). More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_AbortTransmit (SMARTCARD_HandleTypeDef *hsmartcard) |
| Abort ongoing Transmit transfer (blocking mode). More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_AbortReceive (SMARTCARD_HandleTypeDef *hsmartcard) |
| Abort ongoing Receive transfer (blocking mode). More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_Abort_IT (SMARTCARD_HandleTypeDef *hsmartcard) |
| Abort ongoing transfers (Interrupt mode). More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_AbortTransmit_IT (SMARTCARD_HandleTypeDef *hsmartcard) |
| Abort ongoing Transmit transfer (Interrupt mode). More... | |
| HAL_StatusTypeDef | HAL_SMARTCARD_AbortReceive_IT (SMARTCARD_HandleTypeDef *hsmartcard) |
| Abort ongoing Receive transfer (Interrupt mode). More... | |
| void | HAL_SMARTCARD_IRQHandler (SMARTCARD_HandleTypeDef *hsmartcard) |
| Handle SMARTCARD interrupt requests. More... | |
| void | HAL_SMARTCARD_TxCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard) |
| Tx Transfer completed callback. More... | |
| void | HAL_SMARTCARD_RxCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard) |
| Rx Transfer completed callback. More... | |
| void | HAL_SMARTCARD_ErrorCallback (SMARTCARD_HandleTypeDef *hsmartcard) |
| SMARTCARD error callback. More... | |
| void | HAL_SMARTCARD_AbortCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard) |
| SMARTCARD Abort Complete callback. More... | |
| void | HAL_SMARTCARD_AbortTransmitCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard) |
| SMARTCARD Abort Complete callback. More... | |
| void | HAL_SMARTCARD_AbortReceiveCpltCallback (SMARTCARD_HandleTypeDef *hsmartcard) |
| SMARTCARD Abort Receive Complete callback. More... | |
SMARTCARD Transmit and Receive functions.
==============================================================================
##### IO operation functions #####
==============================================================================
[..]
This subsection provides a set of functions allowing to manage the SMARTCARD data transfers.
[..]
Smartcard is a single wire half duplex communication protocol.
The Smartcard interface is designed to support asynchronous protocol Smartcards as
defined in the ISO 7816-3 standard. The USART should be configured as:
(+) 8 bits plus parity: where M=1 and PCE=1 in the USART_CR1 register
(+) 1.5 stop bits when transmitting and receiving: where STOP=11 in the USART_CR2 register.
[..]
(+) 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.
(++) Non-Blocking mode: The communication is performed using Interrupts
or DMA, the relevant API's return the HAL status.
The end of the data processing will be indicated through the
dedicated SMARTCARD IRQ when using Interrupt mode or the DMA IRQ when
using DMA mode.
(++) The HAL_SMARTCARD_TxCpltCallback(), HAL_SMARTCARD_RxCpltCallback() user callbacks
will be executed respectively at the end of the Transmit or Receive process
The HAL_SMARTCARD_ErrorCallback() user callback will be executed when a communication
error is detected.
(+) Blocking mode APIs are :
(++) HAL_SMARTCARD_Transmit()
(++) HAL_SMARTCARD_Receive()
(+) Non Blocking mode APIs with Interrupt are :
(++) HAL_SMARTCARD_Transmit_IT()
(++) HAL_SMARTCARD_Receive_IT()
(++) HAL_SMARTCARD_IRQHandler()
(+) Non Blocking mode functions with DMA are :
(++) HAL_SMARTCARD_Transmit_DMA()
(++) HAL_SMARTCARD_Receive_DMA()
(+) A set of Transfer Complete Callbacks are provided in non Blocking mode:
(++) HAL_SMARTCARD_TxCpltCallback()
(++) HAL_SMARTCARD_RxCpltCallback()
(++) HAL_SMARTCARD_ErrorCallback()
(#) Non-Blocking mode transfers could be aborted using Abort API's :
(+) HAL_SMARTCARD_Abort()
(+) HAL_SMARTCARD_AbortTransmit()
(+) HAL_SMARTCARD_AbortReceive()
(+) HAL_SMARTCARD_Abort_IT()
(+) HAL_SMARTCARD_AbortTransmit_IT()
(+) HAL_SMARTCARD_AbortReceive_IT()
(#) For Abort services based on interrupts (HAL_SMARTCARD_Abortxxx_IT), a set of Abort Complete Callbacks are provided:
(+) HAL_SMARTCARD_AbortCpltCallback()
(+) HAL_SMARTCARD_AbortTransmitCpltCallback()
(+) HAL_SMARTCARD_AbortReceiveCpltCallback()
(#) 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_SMARTCARD_ErrorCallback() user callback is executed. Transfer is kept ongoing on SMARTCARD 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 Frame Error in Interrupt mode tranmission, 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_SMARTCARD_ErrorCallback() user callback is executed. | HAL_StatusTypeDef HAL_SMARTCARD_Abort | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Abort ongoing transfers (blocking mode).
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| HAL | status |
Definition at line 1318 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_Abort_IT | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Abort ongoing transfers (Interrupt mode).
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| HAL | status |
Definition at line 1556 of file stm32l4xx_hal_smartcard.c.
| __weak void HAL_SMARTCARD_AbortCpltCallback | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
SMARTCARD Abort Complete callback.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| None |
Definition at line 2264 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_AbortReceive | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Abort ongoing Receive transfer (blocking mode).
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| HAL | status |
Definition at line 1483 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_AbortReceive_IT | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Abort ongoing Receive transfer (Interrupt mode).
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| HAL | status |
Definition at line 1803 of file stm32l4xx_hal_smartcard.c.
| __weak void HAL_SMARTCARD_AbortReceiveCpltCallback | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
SMARTCARD Abort Receive Complete callback.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| None |
Definition at line 2296 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_AbortTransmit | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Abort ongoing Transmit transfer (blocking mode).
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| HAL | status |
Definition at line 1415 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_AbortTransmit_IT | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Abort ongoing Transmit transfer (Interrupt mode).
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| HAL | status |
Definition at line 1703 of file stm32l4xx_hal_smartcard.c.
| __weak void HAL_SMARTCARD_AbortTransmitCpltCallback | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
SMARTCARD Abort Complete callback.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| None |
Definition at line 2280 of file stm32l4xx_hal_smartcard.c.
| __weak void HAL_SMARTCARD_ErrorCallback | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
SMARTCARD error callback.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| None |
Definition at line 2248 of file stm32l4xx_hal_smartcard.c.
| void HAL_SMARTCARD_IRQHandler | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Handle SMARTCARD interrupt requests.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| None |
Definition at line 1902 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_Receive | ( | SMARTCARD_HandleTypeDef * | hsmartcard, |
| uint8_t * | pData, | ||
| uint16_t | Size, | ||
| uint32_t | Timeout | ||
| ) |
Receive an amount of data in blocking mode.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| pData | pointer to data buffer. |
| Size | amount of data to be received. |
| Timeout | Timeout duration. |
| HAL | status |
Definition at line 907 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_Receive_DMA | ( | SMARTCARD_HandleTypeDef * | hsmartcard, |
| uint8_t * | pData, | ||
| uint16_t | Size | ||
| ) |
Receive an amount of data in DMA mode.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| pData | pointer to data buffer. |
| Size | amount of data to be received. |
| HAL | status |
Definition at line 1238 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_Receive_IT | ( | SMARTCARD_HandleTypeDef * | hsmartcard, |
| uint8_t * | pData, | ||
| uint16_t | Size | ||
| ) |
Receive an amount of data in interrupt mode.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| pData | pointer to data buffer. |
| Size | amount of data to be received. |
| HAL | status |
Definition at line 1074 of file stm32l4xx_hal_smartcard.c.
| __weak void HAL_SMARTCARD_RxCpltCallback | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Rx Transfer completed callback.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| None |
Definition at line 2232 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_Transmit | ( | SMARTCARD_HandleTypeDef * | hsmartcard, |
| uint8_t * | pData, | ||
| uint16_t | Size, | ||
| uint32_t | Timeout | ||
| ) |
Send an amount of data in blocking mode.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| pData | pointer to data buffer. |
| Size | amount of data to be sent. |
| Timeout | Timeout duration. |
| HAL | status |
Definition at line 818 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA | ( | SMARTCARD_HandleTypeDef * | hsmartcard, |
| uint8_t * | pData, | ||
| uint16_t | Size | ||
| ) |
Send an amount of data in DMA mode.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| pData | pointer to data buffer. |
| Size | amount of data to be sent. |
| HAL | status |
Definition at line 1149 of file stm32l4xx_hal_smartcard.c.
| HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT | ( | SMARTCARD_HandleTypeDef * | hsmartcard, |
| uint8_t * | pData, | ||
| uint16_t | Size | ||
| ) |
Send an amount of data in interrupt mode.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| pData | pointer to data buffer. |
| Size | amount of data to be sent. |
| HAL | status |
Definition at line 975 of file stm32l4xx_hal_smartcard.c.
| __weak void HAL_SMARTCARD_TxCpltCallback | ( | SMARTCARD_HandleTypeDef * | hsmartcard | ) |
Tx Transfer completed callback.
| hsmartcard | Pointer to a SMARTCARD_HandleTypeDef structure that contains the configuration information for the specified SMARTCARD module. |
| None |
Definition at line 2216 of file stm32l4xx_hal_smartcard.c.