DMA transfers management functions.
More...
DMA transfers management functions.
Smartcard mode functions.
===============================================================================
##### DMA transfers management functions #####
===============================================================================
===============================================================================
##### Smartcard mode functions #####
===============================================================================
[..] This subsection provides a set of functions allowing to manage the USART
Smartcard communication.
[..] 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.
[..] Smartcard communication is possible through the following procedure:
(#) Configures the Smartcard Prsecaler using the USART_SetPrescaler()
function.
(#) Configures the Smartcard Guard Time using the USART_SetGuardTime()
function.
(#) Program the USART clock using the USART_ClockInit() function as following:
(++) USART Clock enabled.
(++) USART CPOL Low.
(++) USART CPHA on first edge.
(++) USART Last Bit Clock Enabled.
(#) Program the Smartcard interface using the USART_Init() function as
following:
(++) Word Length = 9 Bits.
(++) 1.5 Stop Bit.
(++) Even parity.
(++) BaudRate = 12096 baud.
(++) Hardware flow control disabled (RTS and CTS signals).
(++) Tx and Rx enabled
(#) Optionally you can enable the parity error interrupt using
the USART_ITConfig() function.
(#) Enable the Smartcard NACK using the USART_SmartCardNACKCmd() function.
(#) Enable the Smartcard interface using the USART_SmartCardCmd() function.
(#) Enable the USART using the USART_Cmd() function.
[..]
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.
(@) In smartcard mode, the following bits must be kept cleared:
(+@) LINEN bit in the USART_CR2 register.
(+@) HDSEL and IREN bits in the USART_CR3 register.
Enables or disables the USART's DMA interface.
- Parameters
-
USARTx | where x can be 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or UART peripheral. |
USART_DMAReq | specifies the DMA request. This parameter can be any combination of the following values:
- USART_DMAReq_Tx: USART DMA transmit request
- USART_DMAReq_Rx: USART DMA receive request
|
NewState | new state of the DMA Request sources. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 1099 of file stm32f4xx_usart.c.
void USART_SetAutoRetryCount |
( |
USART_TypeDef * |
USARTx, |
|
|
uint8_t |
USART_AutoCount |
|
) |
| |
Sets the Smart Card number of retries in transmit and receive.
- Parameters
-
USARTx | Select the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3. |
USART_AutoCount | specifies the Smart Card auto retry count. |
- Return values
-
Definition at line 1338 of file stm32f30x_usart.c.
void USART_SetBlockLength |
( |
USART_TypeDef * |
USARTx, |
|
|
uint8_t |
USART_BlockLength |
|
) |
| |
Sets the Smart Card Block length.
- Parameters
-
USARTx | Select the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3. |
USART_BlockLength | specifies the Smart Card block length. |
- Return values
-
Definition at line 1356 of file stm32f30x_usart.c.
void USART_SetGuardTime |
( |
USART_TypeDef * |
USARTx, |
|
|
uint8_t |
USART_GuardTime |
|
) |
| |
Sets the specified USART guard time.
- Parameters
-
USARTx | Select the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3. |
USART_GuardTime | specifies the guard time. |
- Return values
-
Definition at line 1270 of file stm32f30x_usart.c.
Enables or disables the USART's Smart Card mode.
- Parameters
-
USARTx | Select the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3. |
NewState | new state of the Smart Card mode. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 1289 of file stm32f30x_usart.c.
Enables or disables NACK transmission.
- Parameters
-
USARTx | Select the USART peripheral. This parameter can be one of the following values: USART1 or USART2 or USART3. |
NewState | new state of the NACK transmission. This parameter can be: ENABLE or DISABLE. |
- Return values
-
Definition at line 1314 of file stm32f30x_usart.c.