STM32F4xx_HAL_Driver  1.8.3
SMARTCARD Exported Types
+ Collaboration diagram for SMARTCARD Exported Types:

Data Structures

struct  SMARTCARD_InitTypeDef
 SMARTCARD Init Structure definition. More...
 
struct  __SMARTCARD_HandleTypeDef
 SMARTCARD handle Structure definition. More...
 

Typedefs

typedef struct __SMARTCARD_HandleTypeDef SMARTCARD_HandleTypeDef
 SMARTCARD handle Structure definition.
 

Enumerations

enum  HAL_SMARTCARD_StateTypeDef {
  HAL_SMARTCARD_STATE_RESET = 0x00U , HAL_SMARTCARD_STATE_READY = 0x20U , HAL_SMARTCARD_STATE_BUSY = 0x24U , HAL_SMARTCARD_STATE_BUSY_TX = 0x21U ,
  HAL_SMARTCARD_STATE_BUSY_RX = 0x22U , HAL_SMARTCARD_STATE_BUSY_TX_RX = 0x23U , HAL_SMARTCARD_STATE_TIMEOUT = 0xA0U , HAL_SMARTCARD_STATE_ERROR = 0xE0U
}
 HAL SMARTCARD State structures definition. More...
 

Detailed Description


Data Structure Documentation

◆ SMARTCARD_InitTypeDef

struct SMARTCARD_InitTypeDef

SMARTCARD Init Structure definition.

Definition at line 46 of file stm32f4xx_hal_smartcard.h.

Data Fields
uint32_t BaudRate

This member configures the SmartCard communication baud rate. The baud rate is computed using the following formula:

  • IntegerDivider = ((PCLKx) / (16 * (hsc->Init.BaudRate)))
  • FractionalDivider = ((IntegerDivider - ((uint32_t) IntegerDivider)) * 16) + 0.5
uint32_t CLKLastBit

Specifies whether the clock pulse corresponding to the last transmitted data bit (MSB) has to be output on the SCLK pin in synchronous mode. This parameter can be a value of SMARTCARD Last Bit

uint32_t CLKPhase

Specifies the clock transition on which the bit capture is made. This parameter can be a value of SMARTCARD Clock Phase

uint32_t CLKPolarity

Specifies the steady state of the serial clock. This parameter can be a value of SMARTCARD Clock Polarity

uint32_t GuardTime

Specifies the SmartCard Guard Time value in terms of number of baud clocks

uint32_t Mode

Specifies whether the Receive or Transmit mode is enabled or disabled. This parameter can be a value of SMARTCARD Mode

uint32_t NACKState

Specifies the SmartCard NACK Transmission state. This parameter can be a value of SMARTCARD NACK State

uint32_t Parity

Specifies the parity mode. This parameter can be a value of SMARTCARD Parity

Note
When parity is enabled, the computed parity is inserted at the MSB position of the transmitted data (9th bit when the word length is set to 9 data bits; 8th bit when the word length is set to 8 data bits).
uint32_t Prescaler

Specifies the SmartCard Prescaler value used for dividing the system clock to provide the smartcard clock. The value given in the register (5 significant bits) is multiplied by 2 to give the division factor of the source clock frequency. This parameter can be a value of SMARTCARD Prescaler

uint32_t StopBits

Specifies the number of stop bits transmitted. This parameter can be a value of SMARTCARD Number of Stop Bits

uint32_t WordLength

Specifies the number of data bits transmitted or received in a frame. This parameter can be a value of SMARTCARD Word Length

◆ __SMARTCARD_HandleTypeDef

struct __SMARTCARD_HandleTypeDef

SMARTCARD handle Structure definition.

Definition at line 153 of file stm32f4xx_hal_smartcard.h.

+ Collaboration diagram for __SMARTCARD_HandleTypeDef:
Data Fields
__IO uint32_t ErrorCode

SmartCard Error code

__IO HAL_SMARTCARD_StateTypeDef gState

SmartCard state information related to global Handle management and also related to Tx operations. This parameter can be a value of HAL_SMARTCARD_StateTypeDef

DMA_HandleTypeDef * hdmarx

SmartCard Rx DMA Handle parameters

DMA_HandleTypeDef * hdmatx

SmartCard Tx DMA Handle parameters

SMARTCARD_InitTypeDef Init

SmartCard communication parameters

USART_TypeDef * Instance

USART registers base address

HAL_LockTypeDef Lock

Locking object

uint8_t * pRxBuffPtr

Pointer to SmartCard Rx transfer Buffer

const uint8_t * pTxBuffPtr

Pointer to SmartCard Tx transfer Buffer

__IO HAL_SMARTCARD_StateTypeDef RxState

SmartCard state information related to Rx operations. This parameter can be a value of HAL_SMARTCARD_StateTypeDef

__IO uint16_t RxXferCount

SmartCard Rx Transfer Counter

uint16_t RxXferSize

SmartCard Rx Transfer size

__IO uint16_t TxXferCount

SmartCard Tx Transfer Counter

uint16_t TxXferSize

SmartCard Tx Transfer size

Enumeration Type Documentation

◆ HAL_SMARTCARD_StateTypeDef

HAL SMARTCARD State structures definition.

Note
HAL SMARTCARD State value is a combination of 2 different substates: gState and RxState.
  • gState contains SMARTCARD state information related to global Handle management and also information related to Tx operations. gState value coding follow below described bitmap : b7-b6 Error information 00 : No Error 01 : (Not Used) 10 : Timeout 11 : Error b5 IP initialization status 0 : Reset (IP not initialized) 1 : Init done (IP initialized. HAL SMARTCARD Init function already called) b4-b3 (not used) xx : Should be set to 00 b2 Intrinsic process state 0 : Ready 1 : Busy (IP busy with some configuration or internal operations) b1 (not used) x : Should be set to 0 b0 Tx state 0 : Ready (no Tx operation ongoing) 1 : Busy (Tx operation ongoing)
  • RxState contains information related to Rx operations. RxState value coding follow below described bitmap : b7-b6 (not used) xx : Should be set to 00 b5 IP initialization status 0 : Reset (IP not initialized) 1 : Init done (IP initialized) b4-b2 (not used) xxx : Should be set to 000 b1 Rx state 0 : Ready (no Rx operation ongoing) 1 : Busy (Rx operation ongoing) b0 (not used) x : Should be set to 0.
Enumerator
HAL_SMARTCARD_STATE_RESET 

Peripheral is not yet Initialized Value is allowed for gState and RxState

HAL_SMARTCARD_STATE_READY 

Peripheral Initialized and ready for use Value is allowed for gState and RxState

HAL_SMARTCARD_STATE_BUSY 

an internal process is ongoing Value is allowed for gState only

HAL_SMARTCARD_STATE_BUSY_TX 

Data Transmission process is ongoing Value is allowed for gState only

HAL_SMARTCARD_STATE_BUSY_RX 

Data Reception process is ongoing Value is allowed for RxState only

HAL_SMARTCARD_STATE_BUSY_TX_RX 

Data Transmission and Reception process is ongoing Not to be used for neither gState nor RxState. Value is result of combination (Or) between gState and RxState values

HAL_SMARTCARD_STATE_TIMEOUT 

Timeout state Value is allowed for gState only

HAL_SMARTCARD_STATE_ERROR 

Error Value is allowed for gState only

Definition at line 129 of file stm32f4xx_hal_smartcard.h.