#ifndef _7816_3_T1_CONFIG_COMMON_H_ #define _7816_3_T1_CONFIG_COMMON_H_ #ifdef __cplusplus extern "C" { #endif #include #include #include typedef enum { ESESTATUS_SUCCESS = 0, ESESTATUS_FAILED = 1, ESESTATUS_INVALID_PARAMETER = 2, ESESTATUS_NOT_INITIALISED = 3, ESESTATUS_ALREADY_INITIALISED = 4, ESESTATUS_FEATURE_NOT_SUPPORTED = 5, ESESTATUS_CONNECTION_SUCCESS = 6, ESESTATUS_CONNECTION_FAILED = 7, ESESTATUS_BUSY = 8, ESESTATUS_CLOSED = 9, ESESTATUS_OPENED = 10, ESESTATUS_MEM_EXCEPTION = 11, // memory exception ESESTATUS_PH_IO = 12, // write or read failed, return res < 0 ESESTATUS_PH_IOR_INVALID_DATA = 13, // read invalid data ESESTATUS_RES_EXCEPTION = 14, // resource exception ESESTATUS_PARITY_ERROR = 15, // LRC or CRC error ESESTATUS_INVALID_PCB = 16, // not I/R/S PCB ESESTATUS_INVALID_T1_LEN = 17, // T1 INF length not matched ESESTATUS_FATAL_ERROR = 18, // fatal error, need chip do hard reset to recovery. ESESTATUS_UNKNOWN_ERROR = 19, ESESTATUS_NO_DATA_TO_RECEIVE = 20, } ESESTATUS; typedef struct { uint16_t len; uint8_t *p_data; } SE_data; #ifndef LRC_CRC_0 #define LRC_CRC_0 #endif #ifndef USE_SPI_SPLIT_READ #define USE_SPI_SPLIT_READ #endif extern unsigned int config_getUnsigned(const char *key, const unsigned int defaultVal); extern void config_getString(char *buff, const char *key, const char *defaultVal); #ifdef __cplusplus } #endif #endif