#ifndef __SCI7816_H__ #define __SCI7816_H__ #include "yc11xx.h" #define ESAM_NO_GET_RESP 0 #define ESAM_GET_RESP 1 #define ISO7816_NOT_SUPP 0x4E #define ISO7816_ATR_ERROR 0x4F #define ISO7816_ATR_LEN_ERROR 0x50 #define ISO7816_ATR_TCK_ERROR 0x51 #define ISO7816_PROTOCOLTYPE 0x52 #define ISO7816_PROTOCOL_ERROE 0x53 #define ISO7816_T1_LRC_TYPE 0x54 #define ISO7816_T1_LRC_ERROR 0x54 #define ISO7816_T1_CRC_TYPE 0x55 #define ISO7816_CARD_STUTES_ERROR 0x56 #define ISO7816_OPERATE_MODE_ERROR 0x57 #define ISO7816_VCC_CLASS_ERROR 0x58 #define ISO7816_PARA_ERROR 0x59 #define ISO7816_REC_TIMEOUT 0x5A #define ISO7816_TC1_TOO_LARGE 0x5B #define ISO7816_ERR_NUM_OVER 0x5C #define ISO7816_CWT_BWT_INT 0x5D #define ISO7816_RETURN_ERROR 0x5E #define ISO7816_PROTOCOL_ERROR 0x5F #define ISO7816_T1_TRANSFER_ERROR 0x60 #define ISO7816_NULL_T0 0x60 #define OK 0 #define NOK 1 #define ISO7816_ATR_TB1_ERROR 0x70 #define ISO7816_PROCEDURE_INS_ERROR 0x71 #define ISO7816_RESP_STATUS 0x72 void sci7816_clk_enable(void); /** *@brief reset sci7816 *@param presp: pointer to a buf to receive atr *@param respbufsize: the presp buf size *@param prespsize: valid length of the buf receive *@retval 0:success * 1:fail */ uint8_t SCI7816_Reset (uint8_t *presp ,uint8_t respbufsize, uint16_t *prespsize); uint16_t ISO7816_TPDU_T0(uint8_t *pCommand, uint16_t CommandLength, uint8_t *pResponse, uint16_t *pResponseLength); uint16_t ISO7816_Dispose_CMD(uint8_t *pCmd, uint16_t CmdLen, uint8_t *pResp, uint16_t *pRespLen); /** *@brief reset sci7816 *@param pcmd: *@param cmdsize: *@param getrespfalg: *@param presp: *@param respbufsize: *@param prespsize: *@retval None */ uint8_t SCI7816_CosOperation(uint8_t *pcmd, uint16_t cmdsize, uint8_t getrespfalg, uint8_t *presp, uint16_t respbufsize, uint16_t *prespsize); void SCI7816_Power_Off(void); #endif /*__SCI7816_H__*/