STM32L4xx_HAL_Driver  1.14.0
SMARTCARD Exported Types

Data Structures

struct  SMARTCARD_InitTypeDef
 SMARTCARD Init Structure definition. More...
 
struct  SMARTCARD_AdvFeatureInitTypeDef
 SMARTCARD advanced features initalization structure definition. More...
 
struct  __SMARTCARD_HandleTypeDef
 SMARTCARD handle Structure definition. More...
 

Typedefs

typedef uint32_t HAL_SMARTCARD_StateTypeDef
 HAL SMARTCARD State definition. More...
 
typedef struct __SMARTCARD_HandleTypeDef SMARTCARD_HandleTypeDef
 SMARTCARD handle Structure definition. More...
 
typedef void(* pSMARTCARD_CallbackTypeDef) (SMARTCARD_HandleTypeDef *hsmartcard)
 HAL SMARTCARD Callback pointer definition. More...
 

Enumerations

enum  HAL_SMARTCARD_CallbackIDTypeDef {
  HAL_SMARTCARD_TX_COMPLETE_CB_ID = 0x00U, HAL_SMARTCARD_RX_COMPLETE_CB_ID = 0x01U, HAL_SMARTCARD_ERROR_CB_ID = 0x02U, HAL_SMARTCARD_ABORT_COMPLETE_CB_ID = 0x03U,
  HAL_SMARTCARD_ABORT_TRANSMIT_COMPLETE_CB_ID = 0x04U, HAL_SMARTCARD_ABORT_RECEIVE_COMPLETE_CB_ID = 0x05U, HAL_SMARTCARD_RX_FIFO_FULL_CB_ID = 0x06U, HAL_SMARTCARD_TX_FIFO_EMPTY_CB_ID = 0x07U,
  HAL_SMARTCARD_MSPINIT_CB_ID = 0x08U, HAL_SMARTCARD_MSPDEINIT_CB_ID = 0x09U
}
 HAL SMARTCARD Callback ID enumeration definition. More...
 
enum  SMARTCARD_ClockSourceTypeDef {
  SMARTCARD_CLOCKSOURCE_PCLK1 = 0x00U, SMARTCARD_CLOCKSOURCE_PCLK2 = 0x01U, SMARTCARD_CLOCKSOURCE_HSI = 0x02U, SMARTCARD_CLOCKSOURCE_SYSCLK = 0x04U,
  SMARTCARD_CLOCKSOURCE_LSE = 0x08U, SMARTCARD_CLOCKSOURCE_UNDEFINED = 0x10U
}
 SMARTCARD clock sources. More...
 

Detailed Description


Data Structure Documentation

◆ SMARTCARD_InitTypeDef

struct SMARTCARD_InitTypeDef

SMARTCARD Init Structure definition.

Definition at line 47 of file stm32l4xx_hal_smartcard.h.

Data Fields
uint8_t AutoRetryCount

Specifies the SmartCard auto-retry count (number of retries in receive and transmit mode). When set to 0, retransmission is disabled. Otherwise, its maximum value is 7 (before signalling an error)

uint32_t BaudRate

Configures the SmartCard communication baud rate. The baud rate register is computed using the following formula: Baud Rate Register = ((usart_ker_ckpres) / ((hsmartcard->Init.BaudRate))) where usart_ker_ckpres is the USART input clock divided by a prescaler

uint8_t BlockLength

Specifies the SmartCard Block Length in T=1 Reception mode. This parameter can be any value from 0x0 to 0xFF

uint16_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

uint16_t CLKPhase

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

uint16_t CLKPolarity

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

uint32_t ClockPrescaler

Specifies the prescaler value used to divide the USART clock source. This parameter can be a value of Clock Prescaler.

uint8_t GuardTime

Specifies the SmartCard Guard Time applied after stop bits.

uint16_t Mode

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

uint16_t NACKEnable

Specifies whether the SmartCard NACK transmission is enabled in case of parity error. This parameter can be a value of SMARTCARD NACK Enable

uint16_t OneBitSampling

Specifies whether a single sample or three samples' majority vote is selected. Selecting the single sample method increases the receiver tolerance to clock deviations. This parameter can be a value of SMARTCARD One Bit Sampling Method.

uint16_t Parity

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

Note
The parity is enabled by default (PCE is forced to 1). Since the WordLength is forced to 8 bits + parity, M is forced to 1 and the parity bit is the 9th bit.
uint8_t Prescaler

Specifies the SmartCard Prescaler. This parameter can be any value from 0x01 to 0x1F. Prescaler value is multiplied by 2 to give the division factor of the source clock frequency

uint32_t StopBits

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

uint32_t TimeOutEnable

Specifies whether the receiver timeout is enabled. This parameter can be a value of SMARTCARD Timeout Enable

uint32_t TimeOutValue

Specifies the receiver time out value in number of baud blocks: it is used to implement the Character Wait Time (CWT) and Block Wait Time (BWT). It is coded over 24 bits.

uint32_t WordLength

Specifies the number of data bits transmitted or received in a frame. This parameter SMARTCARD Word Length can only be set to 9 (8 data + 1 parity bits).

◆ SMARTCARD_AdvFeatureInitTypeDef

struct SMARTCARD_AdvFeatureInitTypeDef

SMARTCARD advanced features initalization structure definition.

Definition at line 118 of file stm32l4xx_hal_smartcard.h.

Data Fields
uint32_t AdvFeatureInit

Specifies which advanced SMARTCARD features is initialized. Several advanced features may be initialized at the same time. This parameter can be a value of SMARTCARD advanced feature initialization type

uint32_t DataInvert

Specifies whether data are inverted (positive/direct logic vs negative/inverted logic). This parameter can be a value of SMARTCARD advanced feature Binary Data inversion

uint32_t DMADisableonRxError

Specifies whether the DMA is disabled in case of reception error. This parameter can be a value of SMARTCARD advanced feature DMA Disable on Rx Error

uint32_t MSBFirst

Specifies whether MSB is sent first on UART line. This parameter can be a value of SMARTCARD advanced feature MSB first

uint32_t OverrunDisable

Specifies whether the reception overrun detection is disabled. This parameter can be a value of SMARTCARD advanced feature Overrun Disable

uint32_t RxPinLevelInvert

Specifies whether the RX pin active level is inverted. This parameter can be a value of SMARTCARD advanced feature RX pin active level inversion

uint32_t Swap

Specifies whether TX and RX pins are swapped. This parameter can be a value of SMARTCARD advanced feature RX TX pins swap

uint16_t TxCompletionIndication

Specifies which transmission completion indication is used: before (when relevant flag is available) or once guard time period has elapsed. This parameter can be a value of SMARTCARD Transmission Completion Indication.

uint32_t TxPinLevelInvert

Specifies whether the TX pin active level is inverted. This parameter can be a value of SMARTCARD advanced feature TX pin active level inversion

◆ __SMARTCARD_HandleTypeDef

struct __SMARTCARD_HandleTypeDef

SMARTCARD handle Structure definition.

Definition at line 195 of file stm32l4xx_hal_smartcard.h.

Data Fields

USART_TypeDef * Instance
 
SMARTCARD_InitTypeDef Init
 
SMARTCARD_AdvFeatureInitTypeDef AdvancedInit
 
uint8_t * pTxBuffPtr
 
uint16_t TxXferSize
 
__IO uint16_t TxXferCount
 
uint8_t * pRxBuffPtr
 
uint16_t RxXferSize
 
__IO uint16_t RxXferCount
 
uint16_t NbRxDataToProcess
 
uint16_t NbTxDataToProcess
 
uint32_t FifoMode
 
void(* RxISR )(struct __SMARTCARD_HandleTypeDef *huart)
 
void(* TxISR )(struct __SMARTCARD_HandleTypeDef *huart)
 
DMA_HandleTypeDefhdmatx
 
DMA_HandleTypeDefhdmarx
 
HAL_LockTypeDef Lock
 
__IO HAL_SMARTCARD_StateTypeDef gState
 
__IO HAL_SMARTCARD_StateTypeDef RxState
 
__IO uint32_t ErrorCode
 
void(* TxCpltCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* RxCpltCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* ErrorCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* AbortCpltCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* AbortTransmitCpltCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* AbortReceiveCpltCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* RxFifoFullCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* TxFifoEmptyCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* MspInitCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 
void(* MspDeInitCallback )(struct __SMARTCARD_HandleTypeDef *hsmartcard)
 

Field Documentation

◆ AbortCpltCallback

void(* __SMARTCARD_HandleTypeDef::AbortCpltCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Abort Complete Callback

Definition at line 250 of file stm32l4xx_hal_smartcard.h.

◆ AbortReceiveCpltCallback

void(* __SMARTCARD_HandleTypeDef::AbortReceiveCpltCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Abort Receive Complete Callback

Definition at line 254 of file stm32l4xx_hal_smartcard.h.

◆ AbortTransmitCpltCallback

void(* __SMARTCARD_HandleTypeDef::AbortTransmitCpltCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Abort Transmit Complete Callback

Definition at line 252 of file stm32l4xx_hal_smartcard.h.

◆ AdvancedInit

SMARTCARD_AdvFeatureInitTypeDef __SMARTCARD_HandleTypeDef::AdvancedInit

SmartCard advanced features initialization parameters

Definition at line 201 of file stm32l4xx_hal_smartcard.h.

◆ ErrorCallback

void(* __SMARTCARD_HandleTypeDef::ErrorCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Error Callback

Definition at line 248 of file stm32l4xx_hal_smartcard.h.

◆ ErrorCode

__IO uint32_t __SMARTCARD_HandleTypeDef::ErrorCode

SmartCard Error code

Definition at line 241 of file stm32l4xx_hal_smartcard.h.

◆ FifoMode

uint32_t __SMARTCARD_HandleTypeDef::FifoMode

Specifies if the FIFO mode will be used. This parameter can be a value of SMARTCARDEx FIFO mode.

Definition at line 220 of file stm32l4xx_hal_smartcard.h.

◆ gState

__IO HAL_SMARTCARD_StateTypeDef __SMARTCARD_HandleTypeDef::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

Definition at line 234 of file stm32l4xx_hal_smartcard.h.

◆ hdmarx

DMA_HandleTypeDef* __SMARTCARD_HandleTypeDef::hdmarx

SmartCard Rx DMA Handle parameters

Definition at line 230 of file stm32l4xx_hal_smartcard.h.

◆ hdmatx

DMA_HandleTypeDef* __SMARTCARD_HandleTypeDef::hdmatx

SmartCard Tx DMA Handle parameters

Definition at line 228 of file stm32l4xx_hal_smartcard.h.

◆ Init

SMARTCARD_InitTypeDef __SMARTCARD_HandleTypeDef::Init

SmartCard communication parameters

Definition at line 199 of file stm32l4xx_hal_smartcard.h.

◆ Instance

USART_TypeDef* __SMARTCARD_HandleTypeDef::Instance

USART registers base address

Definition at line 197 of file stm32l4xx_hal_smartcard.h.

◆ Lock

HAL_LockTypeDef __SMARTCARD_HandleTypeDef::Lock

Locking object

Definition at line 232 of file stm32l4xx_hal_smartcard.h.

◆ MspDeInitCallback

void(* __SMARTCARD_HandleTypeDef::MspDeInitCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Msp DeInit callback

Definition at line 264 of file stm32l4xx_hal_smartcard.h.

◆ MspInitCallback

void(* __SMARTCARD_HandleTypeDef::MspInitCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Msp Init callback

Definition at line 262 of file stm32l4xx_hal_smartcard.h.

◆ NbRxDataToProcess

uint16_t __SMARTCARD_HandleTypeDef::NbRxDataToProcess

Number of data to process during RX ISR execution

Definition at line 216 of file stm32l4xx_hal_smartcard.h.

◆ NbTxDataToProcess

uint16_t __SMARTCARD_HandleTypeDef::NbTxDataToProcess

Number of data to process during TX ISR execution

Definition at line 218 of file stm32l4xx_hal_smartcard.h.

◆ pRxBuffPtr

uint8_t* __SMARTCARD_HandleTypeDef::pRxBuffPtr

Pointer to SmartCard Rx transfer Buffer

Definition at line 209 of file stm32l4xx_hal_smartcard.h.

◆ pTxBuffPtr

uint8_t* __SMARTCARD_HandleTypeDef::pTxBuffPtr

Pointer to SmartCard Tx transfer Buffer

Definition at line 203 of file stm32l4xx_hal_smartcard.h.

◆ RxCpltCallback

void(* __SMARTCARD_HandleTypeDef::RxCpltCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Rx Complete Callback

Definition at line 246 of file stm32l4xx_hal_smartcard.h.

◆ RxFifoFullCallback

void(* __SMARTCARD_HandleTypeDef::RxFifoFullCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Rx Fifo Full Callback

Definition at line 257 of file stm32l4xx_hal_smartcard.h.

◆ RxISR

void(* __SMARTCARD_HandleTypeDef::RxISR) (struct __SMARTCARD_HandleTypeDef *huart)

Function pointer on Rx IRQ handler

Definition at line 224 of file stm32l4xx_hal_smartcard.h.

◆ RxState

__IO HAL_SMARTCARD_StateTypeDef __SMARTCARD_HandleTypeDef::RxState

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

Definition at line 238 of file stm32l4xx_hal_smartcard.h.

◆ RxXferCount

__IO uint16_t __SMARTCARD_HandleTypeDef::RxXferCount

SmartCard Rx Transfer Counter

Definition at line 213 of file stm32l4xx_hal_smartcard.h.

◆ RxXferSize

uint16_t __SMARTCARD_HandleTypeDef::RxXferSize

SmartCard Rx Transfer size

Definition at line 211 of file stm32l4xx_hal_smartcard.h.

◆ TxCpltCallback

void(* __SMARTCARD_HandleTypeDef::TxCpltCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Tx Complete Callback

Definition at line 244 of file stm32l4xx_hal_smartcard.h.

◆ TxFifoEmptyCallback

void(* __SMARTCARD_HandleTypeDef::TxFifoEmptyCallback) (struct __SMARTCARD_HandleTypeDef *hsmartcard)

SMARTCARD Tx Fifo Empty Callback

Definition at line 259 of file stm32l4xx_hal_smartcard.h.

◆ TxISR

void(* __SMARTCARD_HandleTypeDef::TxISR) (struct __SMARTCARD_HandleTypeDef *huart)

Function pointer on Tx IRQ handler

Definition at line 226 of file stm32l4xx_hal_smartcard.h.

◆ TxXferCount

__IO uint16_t __SMARTCARD_HandleTypeDef::TxXferCount

SmartCard Tx Transfer Counter

Definition at line 207 of file stm32l4xx_hal_smartcard.h.

◆ TxXferSize

uint16_t __SMARTCARD_HandleTypeDef::TxXferSize

SmartCard Tx Transfer size

Definition at line 205 of file stm32l4xx_hal_smartcard.h.

Typedef Documentation

◆ HAL_SMARTCARD_StateTypeDef

typedef uint32_t HAL_SMARTCARD_StateTypeDef

HAL SMARTCARD State definition.

Note
HAL SMARTCARD State value is a combination of 2 different substates: gState and RxState (see SMARTCARD State Code Definition).
  • 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 Peripheral initialization status 0 : Reset (Peripheral not initialized) 1 : Init done (Peripheral not 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 (Peripheral 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 Peripheral initialization status 0 : Reset (Peripheral not initialized) 1 : Init done (Peripheral not 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.

Definition at line 190 of file stm32l4xx_hal_smartcard.h.

◆ pSMARTCARD_CallbackTypeDef

typedef void(* pSMARTCARD_CallbackTypeDef) (SMARTCARD_HandleTypeDef *hsmartcard)

HAL SMARTCARD Callback pointer definition.

pointer to an SMARTCARD callback function

Definition at line 294 of file stm32l4xx_hal_smartcard.h.

◆ SMARTCARD_HandleTypeDef

SMARTCARD handle Structure definition.

Enumeration Type Documentation

◆ HAL_SMARTCARD_CallbackIDTypeDef

HAL SMARTCARD Callback ID enumeration definition.

Enumerator
HAL_SMARTCARD_TX_COMPLETE_CB_ID 

SMARTCARD Tx Complete Callback ID

HAL_SMARTCARD_RX_COMPLETE_CB_ID 

SMARTCARD Rx Complete Callback ID

HAL_SMARTCARD_ERROR_CB_ID 

SMARTCARD Error Callback ID

HAL_SMARTCARD_ABORT_COMPLETE_CB_ID 

SMARTCARD Abort Complete Callback ID

HAL_SMARTCARD_ABORT_TRANSMIT_COMPLETE_CB_ID 

SMARTCARD Abort Transmit Complete Callback ID

HAL_SMARTCARD_ABORT_RECEIVE_COMPLETE_CB_ID 

SMARTCARD Abort Receive Complete Callback ID

HAL_SMARTCARD_RX_FIFO_FULL_CB_ID 

SMARTCARD Rx Fifo Full Callback ID

HAL_SMARTCARD_TX_FIFO_EMPTY_CB_ID 

SMARTCARD Tx Fifo Empty Callback ID

HAL_SMARTCARD_MSPINIT_CB_ID 

SMARTCARD MspInit callback ID

HAL_SMARTCARD_MSPDEINIT_CB_ID 

SMARTCARD MspDeInit callback ID

Definition at line 273 of file stm32l4xx_hal_smartcard.h.

274 {
277  HAL_SMARTCARD_ERROR_CB_ID = 0x02U,
281 #if defined(USART_CR1_FIFOEN)
284 #endif /* USART_CR1_FIFOEN */
285 
HAL_SMARTCARD_CallbackIDTypeDef
HAL SMARTCARD Callback ID enumeration definition.

◆ SMARTCARD_ClockSourceTypeDef

SMARTCARD clock sources.

Enumerator
SMARTCARD_CLOCKSOURCE_PCLK1 

PCLK1 clock source

SMARTCARD_CLOCKSOURCE_PCLK2 

PCLK2 clock source

SMARTCARD_CLOCKSOURCE_HSI 

HSI clock source

SMARTCARD_CLOCKSOURCE_SYSCLK 

SYSCLK clock source

SMARTCARD_CLOCKSOURCE_LSE 

LSE clock source

SMARTCARD_CLOCKSOURCE_UNDEFINED 

undefined clock source

Definition at line 301 of file stm32l4xx_hal_smartcard.h.