HAL SMARTCARD Generic Driver
DMA mode IO operation
Send an amount of data in non blocking mode (DMA) using
HAL_SMARTCARD_Transmit_DMA()
At transmission end of transfer HAL_SMARTCARD_TxCpltCallback is executed and
user can add his own code by customization of function pointer
HAL_SMARTCARD_TxCpltCallback
Receive an amount of data in non blocking mode (DMA) using
HAL_SMARTCARD_Receive_DMA()
At reception end of transfer HAL_SMARTCARD_RxCpltCallback is executed and user
can add his own code by customization of function pointer
HAL_SMARTCARD_RxCpltCallback
In case of transfer Error, HAL_SMARTCARD_ErrorCallback() function is executed and
user can add his own code by customization of function pointer
HAL_SMARTCARD_ErrorCallback
SMARTCARD HAL driver macros list
Below the list of most used macros in SMARTCARD HAL driver.
__HAL_SMARTCARD_ENABLE: Enable the SMARTCARD peripheral
__HAL_SMARTCARD_DISABLE: Disable the SMARTCARD peripheral
__HAL_SMARTCARD_GET_FLAG : Check whether the specified SMARTCARD flag
is set or not
__HAL_SMARTCARD_CLEAR_FLAG : Clear the specified SMARTCARD pending
flag
__HAL_SMARTCARD_ENABLE_IT: Enable the specified SMARTCARD interrupt
__HAL_SMARTCARD_DISABLE_IT: Disable the specified SMARTCARD interrupt
You can refer to the SMARTCARD HAL driver header file for more useful macros
42.2.2 Initialization and Configuration functions
This subsection provides a set of functions allowing to initialize the USART in Smartcard
mode.
The Smartcard interface is designed to support asynchronous protocol Smartcards as
defined in the ISO 7816-3 standard.
The USART can provide a clock to the smartcard through the SCLK output. In smartcard
mode, SCLK is not associated to the communication but is simply derived from the internal
peripheral input clock through a 5-bit prescaler.
For the Smartcard mode only these parameters can be configured:
Baud Rate
Word Length => Should be 9 bits (8 bits + parity)
Stop Bit
Parity: => Should be enabled
USART polarity
USART phase
USART LastBit
Receiver/transmitter modes
Prescaler
GuardTime