31#define SCLIB_MAX_ATR_LEN 32
32#define SCLIB_MIN_ATR_LEN 2
35#define SCLIB_PROTOCOL_UNDEFINED 0x00000000
36#define SCLIB_PROTOCOL_T0 0x00000001
37#define SCLIB_PROTOCOL_T1 0x00000002
39#define SCLIB_SUCCESS 0x00000000
41#define SCLIB_ERR_CARD_REMOVED 0x00000001
42#define SCLIB_ERR_OVER_RUN 0x00000002
43#define SCLIB_ERR_PARITY_ERROR 0x00000003
44#define SCLIB_ERR_NO_STOP 0x00000004
45#define SCLIB_ERR_SILENT_BYTE 0x00000005
46#define SCLIB_ERR_CMD 0x00000006
47#define SCLIB_ERR_UNSUPPORTEDCARD 0x00000007
48#define SCLIB_ERR_READ 0x00000008
49#define SCLIB_ERR_WRITE 0x00000009
50#define SCLIB_ERR_TIME0OUT 0x0000000A
51#define SCLIB_ERR_TIME1OUT 0x0000000B
52#define SCLIB_ERR_TIME2OUT 0x0000000C
53#define SCLIB_ERR_AUTOCONVENTION 0x0000000D
54#define SCLIB_ERR_CLOCK 0x0000000E
55#define SCLIB_ERR_BGTIMEOUT 0x0000000E
57#define SCLIB_ERR_ATR_UNRECOGNIZED 0x00001001
58#define SCLIB_ERR_ATR_INVALID_PARAM 0x00001002
59#define SCLIB_ERR_ATR_INVALID_TCK 0x00001003
60#define SCLIB_ERR_PPS 0x00001004
62#define SCLIB_ERR_T1_PARITY 0x00002001
63#define SCLIB_ERR_T1_ICC 0x00002002
64#define SCLIB_ERR_T1_PROTOCOL 0x00002003
65#define SCLIB_ERR_T1_ABORT_RECEIVED 0x00002004
66#define SCLIB_ERR_T1_RESYNCH_RECEIVED 0x00002005
67#define SCLIB_ERR_T1_VPP_ERROR_RECEIVED 0x00002006
68#define SCLIB_ERR_T1_WTXRES_RECEIVED 0x00002007
69#define SCLIB_ERR_T1_IFSRES_RECEIVED 0x00002008
70#define SCLIB_ERR_T1_ABORTRES_RECEIVED 0x00002009
71#define SCLIB_ERR_T1_CHECKSUM 0x0000200A
74#define SCLIB_ERR_T0_PROTOCOL 0x00003003
77#define SCLIB_ERR_DEACTIVE 0x0000F001
78#define SCLIB_ERR_CARDBUSY 0x0000F002
242#if defined (__GNUC__)
void *__dso_handle __attribute__((weak))
NuMicro peripheral access layer header file.
uint32_t T
Protocol, 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)
uint8_t WI
Wait integer for T0.
uint32_t SCLIB_CheckErrorEvent(uint32_t num)
Process error event in IRQ handler.
uint32_t SCLIB_CheckCDEvent(uint32_t num)
Process card detect event in IRQ handler.
uint8_t chksum
Checksum type.
__weak void SCLIB_RequestTimeExtension(uint32_t u32Protocol)
A callback called by library while smartcard request for a time extension.
uint8_t CWI
Character waiting integer for T1;.
uint8_t BWI
Block waiting integer for T1;.
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.
uint8_t clkStop
Card clock stop status. 00 Not allowed, 01 low, 02, high, 03 ether high or low.
void SCLIB_Deactivate(uint32_t num)
Deactivate a smartcard.
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.
int32_t SCLIB_Activate(uint32_t num, uint32_t u32EMVCheck)
Activate a smartcard.
uint8_t conv
Convention, direct or inverse. 0 direct, 1 inverse.
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.
uint8_t IFSC
size of negotiated IFCS
int32_t SCLIB_StartTransmission(uint32_t num, uint8_t *cmdBuf, uint32_t cmdLen, uint8_t *rspBuf, uint32_t *rspLen)
Start a smartcard transmission.
uint32_t SCLIB_CheckTxRxEvent(uint32_t num)
Process card transmission event in IRQ handler.
int32_t SCLIB_WarmReset(uint32_t num)
Warm reset a smartcard.
int32_t SCLIB_ColdReset(uint32_t num)
Cold reset a smartcard.
uint32_t ATR_Len
ATR length, between SCLIB_MAX_ATR_LEN and SCLIB_MIN_ATR_LEN.
uint32_t SCLIB_CheckTimeOutEvent(uint32_t num)
Process time out event in IRQ handler.
#define SCLIB_MAX_ATR_LEN
Max ATR length. ISO-7816 8.2.1.
A structure holds smartcard attribute, including convention, guard time, waiting time,...
A structure holds smartcard information.