对比新文件 |
| | |
| | | #ifndef _7816_3_T1_SEAPI_H_ |
| | | #define _7816_3_T1_SEAPI_H_ |
| | | |
| | | #ifdef __cplusplus |
| | | extern "C" { |
| | | #endif |
| | | |
| | | #include <stdint.h> |
| | | #include <stdbool.h> |
| | | |
| | | #include "T1.h" |
| | | |
| | | typedef enum |
| | | { |
| | | // All wired transaction |
| | | ESE_MODE_NORMAL = 0, |
| | | // nfcc FW/BL download used |
| | | ESE_MODE_NFCC_DL, |
| | | // eSE COS download used |
| | | ESE_MODE_ESE_DL, |
| | | } SE_init_mode; |
| | | |
| | | typedef struct |
| | | { |
| | | ESESTATUS ESE_lib_status; |
| | | |
| | | bool is_read_done; |
| | | uint32_t max_write_retry_cnt; |
| | | uint32_t write_retry_time; |
| | | uint32_t max_read_retry_cnt; |
| | | uint32_t read_retry_time; |
| | | |
| | | uint32_t max_recovery_cnt; |
| | | |
| | | uint8_t max_blk_retry_cnt; |
| | | |
| | | uint16_t max_wtx_cnt; |
| | | |
| | | bool is_resync_recovery_flag; |
| | | |
| | | uint16_t max_IFSD; |
| | | |
| | | uint16_t max_IFSC; |
| | | |
| | | bool is_T1_ext_hdr_len; |
| | | uint8_t seq_num_device; |
| | | uint8_t seq_num_card; |
| | | bool is_seq_num_dr; |
| | | T1_transmit_receive_state next_T1_state; |
| | | |
| | | /** T1 **/ |
| | | T1_params *p_T1_params; |
| | | } SE_context; |
| | | |
| | | ESESTATUS se_open(SE_init_mode init_mode); |
| | | ESESTATUS se_init(SE_init_mode init_mode); |
| | | |
| | | ESESTATUS se_transmit_receive(SE_data *p_cmd, SE_data *p_resp); |
| | | |
| | | ESESTATUS se_deinit(void); |
| | | ESESTATUS se_status(void); |
| | | ESESTATUS se_close(void); |
| | | |
| | | extern SE_context g_ese_ctx; |
| | | |
| | | /******************************************************************************* |
| | | * @Function tm_main |
| | | * @Parameters None. |
| | | * @Returns 0 - fail; other never return. |
| | | ******************************************************************************/ |
| | | int tm_main(void); |
| | | |
| | | uint16_t passthrough_apdu_to_t1(uint8_t *cmd_buf, uint16_t cmd_len, uint32_t *resp_buf_addr, uint16_t *resp_len); |
| | | uint16_t transmit_only_apdu_to_t1(uint8_t *cmd_buf, uint16_t cmd_len); |
| | | uint16_t receive_only_resp_from_t1(uint32_t *resp_buf_addr, uint16_t *resp_len); |
| | | ESESTATUS se_transmit_only(SE_data *p_cmd); |
| | | ESESTATUS se_receive_only(SE_data *p_resp); |
| | | |
| | | #ifdef __cplusplus |
| | | } |
| | | #endif |
| | | |
| | | #endif /* _STESEAPI_H_ */ |