![]() |
M471M/R1/S BSP V3.01.000
The Board Support Package for M4521
|
Functions | |
int32_t | SCLIB_Activate (uint32_t num, uint32_t u32EMVCheck) |
Activate a smartcard. More... | |
int32_t | SCLIB_ActivateDelay (uint32_t num, uint32_t u32EMVCheck, uint32_t u32Delay) |
Activate a smartcard with large delay between set VCC high and start CLK output. More... | |
int32_t | SCLIB_ColdReset (uint32_t num) |
Cold reset a smartcard. More... | |
int32_t | SCLIB_WarmReset (uint32_t num) |
Warm reset a smartcard. More... | |
void | SCLIB_Deactivate (uint32_t num) |
Deactivate a smartcard. More... | |
int32_t | SCLIB_GetCardInfo (uint32_t num, SCLIB_CARD_INFO_T *s_info) |
Get the card information (e.g., protocol selected, ATR...) after activation success. More... | |
int32_t | SCLIB_GetCardAttrib (uint32_t num, SCLIB_CARD_ATTRIB_T *s_attrib) |
Get the card attribute (e.g., Fi, Di, convention, guard time... etc. ) after activation success. More... | |
int32_t | SCLIB_StartTransmission (uint32_t num, uint8_t *cmdBuf, uint32_t cmdLen, uint8_t *rspBuf, uint32_t *rspLen) |
Start a smartcard transmission. More... | |
int32_t | SCLIB_SetIFSD (uint32_t num, uint8_t size) |
Set interface device max information field size (IFSD) More... | |
__weak void | SCLIB_RequestTimeExtension (uint32_t u32Protocol) |
A callback called by library while smartcard request for a time extension. More... | |
uint32_t | SCLIB_CheckCDEvent (uint32_t num) |
Process card detect event in IRQ handler. More... | |
uint32_t | SCLIB_CheckTimeOutEvent (uint32_t num) |
Process time out event in IRQ handler. More... | |
uint32_t | SCLIB_CheckTxRxEvent (uint32_t num) |
Process card transmission event in IRQ handler. More... | |
uint32_t | SCLIB_CheckErrorEvent (uint32_t num) |
Process error event in IRQ handler. More... | |
Variables | |
uint32_t | SCLIB_CARD_INFO_T::T |
Protocol, ether SCLIB_PROTOCOL_T0 or SCLIB_PROTOCOL_T1. More... | |
uint32_t | SCLIB_CARD_INFO_T::ATR_Len |
ATR length, between SCLIB_MAX_ATR_LEN and SCLIB_MIN_ATR_LEN. More... | |
uint8_t | SCLIB_CARD_INFO_T::ATR_Buf [SCLIB_MAX_ATR_LEN] |
Buffer holds ATR answered by smartcard. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::Fi |
Findex;. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::Di |
Dindex;. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::conv |
Convention, direct or inverse. 0 direct, 1 inverse. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::chksum |
Checksum type. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::GT |
Guard Time. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::WI |
Wait integer for T0. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::BWI |
Block waiting integer for T1;. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::CWI |
Character waiting integer for T1;. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::clkStop |
Card clock stop status. 00 Not allowed, 01 low, 02, high, 03 ether high or low. More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::IFSC |
size of negotiated IFCS More... | |
uint8_t | SCLIB_CARD_ATTRIB_T::NAD |
NAD value. More... | |
int32_t SCLIB_Activate | ( | uint32_t | num, |
uint32_t | u32EMVCheck | ||
) |
Activate a smartcard.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
[in] | u32EMVCheck | Enable EMV error check or not. Valid setting are TRUE and FALSE. By enable EMV error checking, this library will perform ATR checking according to EMV book 1 specification. Otherwise, the error checking follows ISO 7816-3 |
SCLIB_SUCCESS | Smartcard activated successfully |
Others | Smartcard activation failed |
int32_t SCLIB_ActivateDelay | ( | uint32_t | num, |
uint32_t | u32EMVCheck, | ||
uint32_t | u32Delay | ||
) |
Activate a smartcard with large delay between set VCC high and start CLK output.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
[in] | u32EMVCheck | Enable EMV error check or not. Valid setting are TRUE and FALSE. By enable EMV error checking, this library will perform ATR checking according to EMV book 1 specification. Otherwise, the error checking follows ISO 7816-3 |
[in] | u32Delay | Extra delay time between set VCC high and start CLK output, using ETU as time unit. |
SCLIB_SUCCESS | Smartcard activated successfully |
Others | Smartcard activation failed |
uint32_t SCLIB_CheckCDEvent | ( | uint32_t | num | ) |
Process card detect event in IRQ handler.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
1 | Card detect event occurred |
0 | Card detect event did not occur |
uint32_t SCLIB_CheckErrorEvent | ( | uint32_t | num | ) |
Process error event in IRQ handler.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
1 | Error event occurred |
0 | Error event did not occur |
uint32_t SCLIB_CheckTimeOutEvent | ( | uint32_t | num | ) |
Process time out event in IRQ handler.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
1 | Time out event occurred |
0 | Time out event did not occur |
uint32_t SCLIB_CheckTxRxEvent | ( | uint32_t | num | ) |
Process card transmission event in IRQ handler.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
1 | Transmission event occurred |
0 | Transmission event did not occur |
int32_t SCLIB_ColdReset | ( | uint32_t | num | ) |
Cold reset a smartcard.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
SCLIB_SUCCESS | Smartcard cold reset success |
Others | Smartcard cold reset failed |
void SCLIB_Deactivate | ( | uint32_t | num | ) |
Deactivate a smartcard.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
int32_t SCLIB_GetCardAttrib | ( | uint32_t | num, |
SCLIB_CARD_ATTRIB_T * | s_attrib | ||
) |
Get the card attribute (e.g., Fi, Di, convention, guard time... etc. ) after activation success.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
[out] | s_attrib | A pointer to SCLIB_CARD_ATTRIB_T holds the card information |
SCLIB_SUCCESS | Success, s_info contains card information |
SCLIB_ERR_CARD_REMOVED | Card removed, s_info does not contains card information |
SCLIB_ERR_DEACTIVE | Card is deactivated, s_info does not contains card information |
int32_t SCLIB_GetCardInfo | ( | uint32_t | num, |
SCLIB_CARD_INFO_T * | s_info | ||
) |
Get the card information (e.g., protocol selected, ATR...) after activation success.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
[out] | s_info | A pointer to SCLIB_CARD_INFO_T holds the card information |
SCLIB_SUCCESS | Success, s_info contains card information |
SCLIB_ERR_CARD_REMOVED | Card removed, s_info does not contains card information |
SCLIB_ERR_DEACTIVE | Card is deactivated, s_info does not contains card information |
__weak void SCLIB_RequestTimeExtension | ( | uint32_t | u32Protocol | ) |
A callback called by library while smartcard request for a time extension.
[in] | u32Protocol | What protocol the card is using while it requested for a time extension. Could be ether SCLIB_PROTOCOL_T0 or SCLIB_PROTOCOL_T1 |
int32_t SCLIB_SetIFSD | ( | uint32_t | num, |
uint8_t | size | ||
) |
Set interface device max information field size (IFSD)
This function sends S block to notify card about the max size of information filed blocks that can be received by the interface device. According to EMV 9.2.4.3, this should be the first block transmitted by terminal to ICC after ATR.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
[in] | size | IFSD size. According to EMV spec 9.2.4.3 Error Free Operation, this field must be 0xFE. |
SCLIB_SUCCESS | Smartcard warm reset success |
Others | Smartcard warm reset failed |
int32_t SCLIB_StartTransmission | ( | uint32_t | num, |
uint8_t * | cmdBuf, | ||
uint32_t | cmdLen, | ||
uint8_t * | rspBuf, | ||
uint32_t * | rspLen | ||
) |
Start a smartcard transmission.
SCLIB will start a transmission according to the protocol selected
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
[in] | cmdBuf | Command buffer pointer |
[in] | cmdLen | Command length |
[out] | rspBuf | Buffer to holds card response |
[out] | rspLen | Response length received |
SCLIB_SUCCESS | Transmission success. rspBuf and rspLen holds response data and length |
Others | Transmission failed |
int32_t SCLIB_WarmReset | ( | uint32_t | num | ) |
Warm reset a smartcard.
[in] | num | Smartcard interface number. From 0 ~ ( SC_INTERFACE_NUM - 1) |
SCLIB_SUCCESS | Smartcard warm reset success |
Others | Smartcard warm reset failed |
uint8_t SCLIB_CARD_INFO_T::ATR_Buf[SCLIB_MAX_ATR_LEN] |
uint32_t SCLIB_CARD_INFO_T::ATR_Len |
uint8_t SCLIB_CARD_ATTRIB_T::BWI |
uint8_t SCLIB_CARD_ATTRIB_T::clkStop |
uint8_t SCLIB_CARD_ATTRIB_T::conv |
uint8_t SCLIB_CARD_ATTRIB_T::CWI |
uint32_t SCLIB_CARD_INFO_T::T |
Protocol, ether SCLIB_PROTOCOL_T0 or SCLIB_PROTOCOL_T1.