![]() |
M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
|
Macros | |
#define | SC_ENABLE_INT(sc, u32Mask) |
Enable smartcard interrupt. More... | |
#define | SC_DISABLE_INT(sc, u32Mask) |
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) |
Set CLK output status. More... | |
#define | SC_SET_IO_PIN(sc, u32State) |
Set I/O pin state. More... | |
#define | SC_SET_RST_PIN(sc, u32State) |
Set RST pin state. More... | |
#define | SC_READ(sc) |
Read one byte from smartcard module receive FIFO. More... | |
#define | SC_WRITE(sc, u8Data) |
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) |
Reset the Tx/Rx FIFO. 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) |
Set Block Guard Time. More... | |
void | SC_SetCharGuardTime (SC_T *sc, uint32_t u32CGT) |
Set character guard time. More... | |
void | SC_StopAllTimer (SC_T *sc) |
Stop all Timer counting. 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) |
Stop Timer counting. More... | |
#define SC_DISABLE_INT | ( | sc, | |
u32Mask | |||
) |
Disable smartcard interrupt.
[in] | sc | The pointer of smartcard module. |
[in] | u32Mask | Interrupt mask to be disabled. A combination of |
The macro is used to disable Auto-convention error interrupt, Receiver buffer time-out interrupt, Initial end interrupt, Card detect interrupt, Block guard time interrupt, Timer2 interrupt, Timer1 interrupt, Timer0 interrupt, Transfer error interrupt, Transmit buffer empty interrupt or Receive data reach trigger level interrupt.
#define SC_ENABLE_INT | ( | sc, | |
u32Mask | |||
) |
Enable smartcard interrupt.
[in] | sc | The pointer of smartcard module. |
[in] | u32Mask | Interrupt mask to be enabled. A combination of |
The macro is used to enable Auto-convention error interrupt, Receiver buffer time-out interrupt, Initial end interrupt, Card detect interrupt, Block guard time interrupt, Timer2 interrupt, Timer1 interrupt, Timer0 interrupt, Transfer error interrupt, Transmit buffer empty interrupt or Receive data reach trigger level interrupt.
#define SC_READ | ( | sc | ) |
#define SC_SET_CLK_PIN | ( | sc, | |
u32OnOff | |||
) |
Set CLK output status.
[in] | sc | The pointer of smartcard module. |
[in] | u32OnOff | Clock on or off for selected smartcard module, valid values are: SC_CLK_ON :Smartcard clock on. SC_CLK_OFF :Smartcard clock off. |
User can set CLKKEEP (SC_PINCTL[6]) to decide SC_CLK pin always keeps free running or not.
#define SC_SET_IO_PIN | ( | sc, | |
u32State | |||
) |
Set I/O pin state.
[in] | sc | The pointer of smartcard module. |
[in] | u32State | Pin state of I/O pin, valid parameters are: SC_PIN_STATE_HIGH :Smartcard pin status high. SC_PIN_STATE_LOW :Smartcard pin status low. |
User can set SCDOUT(SC_PINCTL[9]) to decide SCDOUT pin to high or low.
#define SC_SET_RST_PIN | ( | sc, | |
u32State | |||
) |
Set RST pin state.
[in] | sc | The pointer of smartcard module. |
[in] | u32State | Pin state of RST pin, valid parameters are: SC_PIN_STATE_HIGH :Smartcard pin status high. SC_PIN_STATE_LOW :Smartcard pin status low. |
User can set SCRST(SC_PINCTL[1]) to decide SCRST pin to high or low.
#define SC_SET_STOP_BIT_LEN | ( | sc, | |
u32Len | |||
) |
#define SC_SET_VCC_PIN | ( | sc, | |
u32State | |||
) |
This macro set VCC pin state of smartcard interface.
[in] | sc | The pointer of smartcard module. |
[in] | u32State | Pin state of VCC pin, valid parameters are: SC_PIN_STATE_HIGH :Smartcard pin status high. SC_PIN_STATE_LOW :Smartcard pin status low. |
User can set PWREN (SC_PINCTL[0]) and PWRINV (SC_PINCTL[11])to decide SC_PWR pin is in high or low level.
#define SC_WRITE | ( | sc, | |
u8Data | |||
) |
void SC_ClearFIFO | ( | SC_T * | sc | ) |
void SC_Close | ( | SC_T * | sc | ) |
uint32_t SC_IsCardInserted | ( | SC_T * | sc | ) |
void SC_Open | ( | SC_T * | sc, |
uint32_t | u32CD, | ||
uint32_t | u32PWR | ||
) |
This function initialized smartcard module.
[in] | sc | The pointer of smartcard module. |
[in] | u32CD | Card detect polarity, select the CD pin state which indicates card absent. Could be: -SC_PIN_STATE_HIGH. -SC_PIN_STATE_LOW. -SC_PIN_STATE_IGNORE, no card detect pin, always assumes card present. |
[in] | u32PWR | Power off polarity, select the PWR pin state which could set smartcard VCC to high level. Could be: -SC_PIN_STATE_HIGH. -SC_PIN_STATE_LOW. |
Initialization process configures smartcard and enables engine clock.
void SC_ResetReader | ( | SC_T * | sc | ) |
void SC_SetBlockGuardTime | ( | SC_T * | sc, |
uint32_t | u32BGT | ||
) |
void SC_SetCharGuardTime | ( | SC_T * | sc, |
uint32_t | u32CGT | ||
) |
Set character guard time.
[in] | sc | The pointer of smartcard module. |
[in] | u32CGT | Character guard time using ETU as unit, valid range are between 11 ~ 267. |
This function character guard time (CGT) of specified smartcard module.
__STATIC_INLINE void SC_SetRxRetry | ( | SC_T * | sc, |
uint32_t | u32Count | ||
) |
Enable/Disable Rx error retry, and set Rx error retry count.
[in] | sc | The pointer of smartcard module. |
[in] | u32Count | The number of times of Rx error retry count, between 0~8. 0 means disable Rx error retry. |
This macro enable/disable receiver retry function when parity error has occurred, and set error retry count.
__STATIC_INLINE void SC_SetTxRetry | ( | SC_T * | sc, |
uint32_t | u32Count | ||
) |
Enable/Disable Tx error retry, and set Tx error retry count.
[in] | sc | The pointer of smartcard module. |
[in] | u32Count | The number of times of Tx error retry count, between 0~8. 0 means disable Tx error retry. |
This macro enable/disable transmitter retry function when parity error has occurred, and set error retry count.
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.
[in] | sc | The pointer of smartcard module. |
[in] | u32TimerNum | Timer(s) to start. Valid values are 0, 1, 2. |
[in] | u32Mode | Timer operating mode, valid values are: |
[in] | u32ETUCount | Timer 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. |
Enable Timer starting, counter will count when condition match.
void SC_StopAllTimer | ( | SC_T * | sc | ) |
void SC_StopTimer | ( | SC_T * | sc, |
uint32_t | u32TimerNum | ||
) |
Stop Timer counting.
[in] | sc | The pointer of smartcard module. |
[in] | u32TimerNum | Timer(s) to stop. Valid values are 0, 1, 2. |
This function stop a smartcard timer of specified smartcard module.