UM1940
Recommended SmartCard interface configuration to get the Answer to Reset from the
Card:
Please refer to the ISO 7816-3 specification for more details. -@- It is also possible to
choose 0.5 stop bit for receiving but it is recommended to use 1.5 stop bits for both
transmitting and receiving to avoid switching between the two configurations.
The HAL_SMARTCARD_Init() function follows the USART SmartCard configuration
procedure (details for the procedure are available in reference manual (RM0329)).
This section contains the following APIs:
HAL_SMARTCARD_Init()
HAL_SMARTCARD_DeInit()
HAL_SMARTCARD_MspInit()
HAL_SMARTCARD_MspDeInit()
HAL_SMARTCARD_ReInit()
42.2.3
IO operation functions
This subsection provides a set of functions allowing to manage the SMARTCARD data
transfers.
1.
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.
2.
The USART should be configured as:
3.
There are two modes of transfer:
4.
Blocking mode APIs are :
5.
Non Blocking mode APIs with Interrupt are :
6.
Non Blocking mode functions with DMA are :
NACKState: The Smartcard NACK state
Word Length = 9 Bits
1.5 Stop Bit
Even parity
BaudRate = 12096 baud
Tx and Rx enabled
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.
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,
These APIs 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
HAL_SMARTCARD_Transmit()
HAL_SMARTCARD_Receive()
HAL_SMARTCARD_Transmit_IT()
HAL_SMARTCARD_Receive_IT()
HAL_SMARTCARD_IRQHandler()
HAL_SMARTCARD_Transmit_DMA()
DocID028236 Rev 2
HAL SMARTCARD Generic Driver
535/1371
Need help?
Do you have a question about the STM32F2 and is the answer not in the manual?
Questions and answers