112 lines
2.6 KiB
C
112 lines
2.6 KiB
C
#ifndef DP1312EA_NFC_H
|
|
#define DP1312EA_NFC_H
|
|
|
|
#include <stdint.h>
|
|
|
|
typedef uint8_t u8;
|
|
typedef int8_t s8;
|
|
typedef uint16_t u16;
|
|
typedef int16_t s16;
|
|
typedef uint32_t u32;
|
|
typedef int32_t s32;
|
|
typedef int8_t int8;
|
|
typedef uint8_t uint8;
|
|
typedef uint16_t uint16;
|
|
typedef uint32_t uint32;
|
|
|
|
#define PICC_REQIDL 0x26
|
|
#define PICC_REQALL 0x52
|
|
#define PICC_ANTICOLL1 0x93
|
|
#define PICC_ANTICOLL2 0x95
|
|
#define PICC_ANTICOLL3 0x97
|
|
#define PICC_AUTHENT1A 0x60
|
|
#define PICC_AUTHENT1B 0x61
|
|
#define PICC_READ 0x30
|
|
#define PICC_WRITE 0xA0
|
|
#define PICC_DECREMENT 0xC0
|
|
#define PICC_INCREMENT 0xC1
|
|
#define PICC_RESTORE 0xC2
|
|
#define PICC_TRANSFER 0xB0
|
|
#define PICC_HALT 0x50
|
|
|
|
#define SELECT_0 0x93
|
|
#define SELECT_1 0x95
|
|
#define SELECT_2 0x97
|
|
|
|
#define PICC_ANTI 0x05
|
|
#define PICC_ATTRIB 0x1D
|
|
|
|
#define MI_OK 0
|
|
#define MI_CHK_OK 0
|
|
#define MI_NOTAGERR (-1)
|
|
#define MI_CHK_FAILED (-1)
|
|
#define MI_CRCERR (-2)
|
|
#define MI_CHK_COMPERR (-2)
|
|
#define MI_EMPTY (-3)
|
|
#define MI_AUTHERR (-4)
|
|
#define MI_PARITYERR (-5)
|
|
#define MI_CODEERR (-6)
|
|
#define MI_SERNRERR (-8)
|
|
#define MI_KEYERR (-9)
|
|
#define MI_NOTAUTHERR (-10)
|
|
#define MI_BITCOUNTERR (-11)
|
|
#define MI_BYTECOUNTERR (-12)
|
|
#define MI_IDLE (-13)
|
|
#define MI_TRANSERR (-14)
|
|
#define MI_WRITEERR (-15)
|
|
#define MI_INCRERR (-16)
|
|
#define MI_DECRERR (-17)
|
|
#define MI_READERR (-18)
|
|
#define MI_OVFLERR (-19)
|
|
#define MI_POLLING (-20)
|
|
#define MI_FRAMINGERR (-21)
|
|
#define MI_ACCESSERR (-22)
|
|
#define MI_UNKNOWN_COMMAND (-23)
|
|
#define MI_COLLERR (-24)
|
|
#define MI_RESETERR (-25)
|
|
#define MI_INITERR (-25)
|
|
#define MI_INTERFACEERR (-26)
|
|
#define MI_ACCESSTIMEOUT (-27)
|
|
#define MI_NOBITWISEANTICOLL (-28)
|
|
#define MI_QUIT (-30)
|
|
#define MI_RECBUF_OVERFLOW (-50)
|
|
#define MI_SENDBYTENR (-51)
|
|
#define MI_SENDBUF_OVERFLOW (-53)
|
|
#define MI_BAUDRATE_NOT_SUPPORTED (-54)
|
|
#define MI_SAME_BAUDRATE_REQUIRED (-55)
|
|
#define MI_WRONG_PARAMETER_VALUE (-60)
|
|
#define MI_BREAK (-99)
|
|
#define MI_NY_IMPLEMENTED (-100)
|
|
#define MI_NO_MFRC (-101)
|
|
#define MI_MFRC_NOTAUTH (-102)
|
|
#define MI_WRONG_DES_MODE (-103)
|
|
#define MI_HOST_AUTH_FAILED (-104)
|
|
#define MI_WRONG_LOAD_MODE (-106)
|
|
#define MI_WRONG_DESKEY (-107)
|
|
#define MI_MKLOAD_FAILED (-108)
|
|
#define MI_FIFOERR (-109)
|
|
#define MI_WRONG_ADDR (-110)
|
|
#define MI_DESKEYLOAD_FAILED (-111)
|
|
#define MI_WRONG_SEL_CNT (-114)
|
|
#define MI_WRONG_TEST_MODE (-117)
|
|
#define MI_TEST_FAILED (-118)
|
|
#define MI_TOC_ERROR (-119)
|
|
#define MI_COMM_ABORT (-120)
|
|
#define MI_INVALID_BASE (-121)
|
|
#define MI_MFRC_RESET (-122)
|
|
#define MI_WRONG_VALUE (-123)
|
|
#define MI_VALERR (-124)
|
|
#define MI_COM_ERR (-125)
|
|
#define MI_ERR (-126)
|
|
|
|
#define DEF_FIFO_LENGTH 64
|
|
#define MAXRLEN 18
|
|
|
|
struct TranSciveBuffer {
|
|
u8 MfCommand;
|
|
u16 MfLength;
|
|
u8 MfData[DEF_FIFO_LENGTH];
|
|
};
|
|
|
|
#endif
|