NANO102/112 BSP V3.03.003
The Board Support Package for Nano102/112 Series
Macros | Functions
Collaboration diagram for SC Exported Functions:

Macros

#define SC_ENABLE_INT(sc, u32Mask)
 This macro enable smartcard interrupt. More...
 
#define SC_DISABLE_INT(sc, u32Mask)
 This macro disable smartcard interrupt. More...
 
#define SC_SET_VCC_PIN(sc, u32State)
 This macro set VCC pin state of smartcard interface. More...
 
#define SC_SET_CLK_PIN(sc, u32OnOff)
 This macro turns CLK output on or off. More...
 
#define SC_SET_IO_PIN(sc, u32State)
 This macro set I/O pin state of smartcard interface. More...
 
#define SC_SET_RST_PIN(sc, u32State)
 This macro set RST pin state of smartcard interface. More...
 
#define SC_READ(sc)
 This macro read one byte from smartcard module receive FIFO. More...
 
#define SC_WRITE(sc, u8Data)
 This macro write one byte to smartcard module transmit FIFO. More...
 
#define SC_SET_STOP_BIT_LEN(sc, u32Len)
 This macro set smartcard stop bit length. More...
 

Functions

__STATIC_INLINE void SC_SetTxRetry (SC_T *sc, uint32_t u32Count)
 Enable/Disable Tx error retry, and set Tx error retry count. More...
 
__STATIC_INLINE void SC_SetRxRetry (SC_T *sc, uint32_t u32Count)
 Enable/Disable Rx error retry, and set Rx error retry count. More...
 
uint32_t SC_IsCardInserted (SC_T *sc)
 This function indicates specified smartcard slot status. More...
 
void SC_ClearFIFO (SC_T *sc)
 This function reset both transmit and receive FIFO of specified smartcard module. More...
 
void SC_Close (SC_T *sc)
 This function disable specified smartcard module. More...
 
void SC_Open (SC_T *sc, uint32_t u32CD, uint32_t u32PWR)
 This function initialized smartcard module. More...
 
void SC_ResetReader (SC_T *sc)
 This function reset specified smartcard module to its default state for activate smartcard. More...
 
void SC_SetBlockGuardTime (SC_T *sc, uint32_t u32BGT)
 This function block guard time (BGT) of specified smartcard module. More...
 
void SC_SetCharGuardTime (SC_T *sc, uint32_t u32CGT)
 This function character guard time (CGT) of specified smartcard module. More...
 
void SC_StopAllTimer (SC_T *sc)
 This function stop all smartcard timer of specified smartcard module. More...
 
void SC_StartTimer (SC_T *sc, uint32_t u32TimerNum, uint32_t u32Mode, uint32_t u32ETUCount)
 This function configure and start a smartcard timer of specified smartcard module. More...
 
void SC_StopTimer (SC_T *sc, uint32_t u32TimerNum)
 This function stop a smartcard timer of specified smartcard module. More...
 

Detailed Description

Macro Definition Documentation

◆ SC_DISABLE_INT

#define SC_DISABLE_INT (   sc,
  u32Mask 
)

This macro disable smartcard interrupt.

Parameters
[in]scBase address of smartcard module
[in]u32MaskInterrupt mask to be disabled. A combination of
Returns
None

Definition at line 96 of file sc.h.

◆ SC_ENABLE_INT

#define SC_ENABLE_INT (   sc,
  u32Mask 
)

This macro enable smartcard interrupt.

Parameters
[in]scBase address of smartcard module
[in]u32MaskInterrupt mask to be enabled. A combination of
Returns
None

Definition at line 76 of file sc.h.

◆ SC_READ

#define SC_READ (   sc)

This macro read one byte from smartcard module receive FIFO.

Parameters
[in]scBase address of smartcard module
Returns
One byte read from receive FIFO

Definition at line 165 of file sc.h.

◆ SC_SET_CLK_PIN

#define SC_SET_CLK_PIN (   sc,
  u32OnOff 
)

This macro turns CLK output on or off.

Parameters
[in]scBase address of smartcard module
[in]u32OnOffClock on or off for selected smartcard module, valid values are SC_CLK_ON and SC_CLK_OFF
Returns
None

Definition at line 121 of file sc.h.

◆ SC_SET_IO_PIN

#define SC_SET_IO_PIN (   sc,
  u32State 
)

This macro set I/O pin state of smartcard interface.

Parameters
[in]scBase address of smartcard module
[in]u32StatePin state of I/O pin, valid parameters are SC_PIN_STATE_HIGH and SC_PIN_STATE_LOW
Returns
None

Definition at line 136 of file sc.h.

◆ SC_SET_RST_PIN

#define SC_SET_RST_PIN (   sc,
  u32State 
)

This macro set RST pin state of smartcard interface.

Parameters
[in]scBase address of smartcard module
[in]u32StatePin state of RST pin, valid parameters are SC_PIN_STATE_HIGH and SC_PIN_STATE_LOW
Returns
None

Definition at line 151 of file sc.h.

◆ SC_SET_STOP_BIT_LEN

#define SC_SET_STOP_BIT_LEN (   sc,
  u32Len 
)

This macro set smartcard stop bit length.

Parameters
[in]scBase address of smartcard module
[in]u32LenStop bit length, ether 1 or 2.
Returns
None

Stop bit length must be 1 for T = 1 protocol and 2 for T = 0 protocol.

Definition at line 184 of file sc.h.

◆ SC_SET_VCC_PIN

#define SC_SET_VCC_PIN (   sc,
  u32State 
)

This macro set VCC pin state of smartcard interface.

Parameters
[in]scBase address of smartcard module
[in]u32StatePin state of VCC pin, valid parameters are SC_PIN_STATE_HIGH and SC_PIN_STATE_LOW
Returns
None

Definition at line 105 of file sc.h.

◆ SC_WRITE

#define SC_WRITE (   sc,
  u8Data 
)

This macro write one byte to smartcard module transmit FIFO.

Parameters
[in]scBase address of smartcard module
[in]u8DataData to write to transmit FIFO
Returns
None

Definition at line 174 of file sc.h.

Function Documentation

◆ SC_ClearFIFO()

void SC_ClearFIFO ( SC_T sc)

This function reset both transmit and receive FIFO of specified smartcard module.

Parameters
[in]scBase address of smartcard module
Returns
None

Definition at line 61 of file sc.c.

◆ SC_Close()

void SC_Close ( SC_T sc)

This function disable specified smartcard module.

Parameters
[in]scBase address of smartcard module
Returns
None

Definition at line 71 of file sc.c.

◆ SC_IsCardInserted()

uint32_t SC_IsCardInserted ( SC_T sc)

This function indicates specified smartcard slot status.

Parameters
[in]scBase address of smartcard module
Returns
Card insert status
Return values
TRUECard insert
FALSECard remove

Definition at line 40 of file sc.c.

◆ SC_Open()

void SC_Open ( SC_T sc,
uint32_t  u32CD,
uint32_t  u32PWR 
)

This function initialized smartcard module.

Parameters
[in]scBase address of smartcard module
[in]u32CDCard detect polarity, select the CD pin state which indicates card is absent. Could be
[in]u32PWRPower off polarity, select the PWR pin state which could set smartcard VCC to high level. Could be
Returns
None

Definition at line 91 of file sc.c.

◆ SC_ResetReader()

void SC_ResetReader ( SC_T sc)

This function reset specified smartcard module to its default state for activate smartcard.

Parameters
[in]scBase address of smartcard module
Returns
None

Definition at line 119 of file sc.c.

◆ SC_SetBlockGuardTime()

void SC_SetBlockGuardTime ( SC_T sc,
uint32_t  u32BGT 
)

This function block guard time (BGT) of specified smartcard module.

Parameters
[in]scBase address of smartcard module
[in]u32BGTBlock guard time using ETU as unit, valid range are between 1 ~ 32
Returns
None

Definition at line 174 of file sc.c.

◆ SC_SetCharGuardTime()

void SC_SetCharGuardTime ( SC_T sc,
uint32_t  u32CGT 
)

This function character guard time (CGT) of specified smartcard module.

Parameters
[in]scBase address of smartcard module
[in]u32CGTCharacter guard time using ETU as unit, valid range are between 11 ~ 267
Returns
None

Definition at line 185 of file sc.c.

◆ SC_SetRxRetry()

__STATIC_INLINE void SC_SetRxRetry ( SC_T sc,
uint32_t  u32Count 
)

Enable/Disable Rx error retry, and set Rx error retry count.

Parameters
[in]scBase address of smartcard module
[in]u32CountThe number of times of Rx error retry count, between 0~8. 0 means disable Rx error retry
Returns
None

Definition at line 208 of file sc.h.

◆ SC_SetTxRetry()

__STATIC_INLINE void SC_SetTxRetry ( SC_T sc,
uint32_t  u32Count 
)

Enable/Disable Tx error retry, and set Tx error retry count.

Parameters
[in]scBase address of smartcard module
[in]u32CountThe number of times of Tx error retry count, between 0~8. 0 means disable Tx error retry
Returns
None

Definition at line 192 of file sc.h.

◆ SC_StartTimer()

void SC_StartTimer ( SC_T sc,
uint32_t  u32TimerNum,
uint32_t  u32Mode,
uint32_t  u32ETUCount 
)

This function configure and start a smartcard timer of specified smartcard module.

Parameters
[in]scBase address of smartcard module
[in]u32TimerNumTimer(s) to start. Valid values are 0, 1, 2.
[in]u32ModeTimer operating mode, valid values are:
[in]u32ETUCountTimer timeout duration, ETU based. For timer 0, valid range are between 1~0x1000000ETUs. For timer 1 and timer 2, valid range are between 1 ~ 0x100 ETUs
Returns
None
Note
This function start the timer within smartcard module, not timer module
Depend on the timer operating mode, timer may not start counting immediately

Definition at line 223 of file sc.c.

◆ SC_StopAllTimer()

void SC_StopAllTimer ( SC_T sc)

This function stop all smartcard timer of specified smartcard module.

Parameters
[in]scBase address of smartcard module
Returns
None
Note
This function stop the timers within smartcard module, not timer module

Definition at line 197 of file sc.c.

◆ SC_StopTimer()

void SC_StopTimer ( SC_T sc,
uint32_t  u32TimerNum 
)

This function stop a smartcard timer of specified smartcard module.

Parameters
[in]scBase address of smartcard module
[in]u32TimerNumTimer(s) to stop. Valid values are 0, 1, 2.
Returns
None
Note
This function stop the timer within smartcard module, not timer module

Definition at line 251 of file sc.c.