12 #ifndef HAL_SYNC7816_H 13 #define HAL_SYNC7816_H 15 #include "./hal/hal_power.h" 16 #include "./hal/hal_counter.h" 29 SYNC7816_ERR_INVALID_PARAM = -1,
30 SYNC7816_ERR_TIMEOUT = -2,
31 SYNC7816_ERR_LOCK = -3,
34 typedef struct sync7816_init {
82 int fm4428_read_cmd(
void* dev, uint32_t cmd, uint32_t addr, uint32_t *rx_data, uint32_t rx_len);
92 int fm4428_read_byte(
void* dev, uint32_t addr,
int protect, uint8_t *rx_data);
103 int fm4428_write_cmd(
void* dev, uint32_t cmd, uint32_t addr, uint8_t data, uint32_t wait_clk);
133 int fm4442_read_cmd(
void* dev, uint32_t cmd, uint32_t addr, uint32_t *rx_data, uint32_t rx_len);
int fm4428_read_cmd(void *dev, uint32_t cmd, uint32_t addr, uint32_t *rx_data, uint32_t rx_len)
Send read command for fm4428 chip.
int fm4428_write_cmd(void *dev, uint32_t cmd, uint32_t addr, uint8_t data, uint32_t wait_clk)
Send write command for fm4428 chip.
void hal_sync7816_close(void *dev)
Close sync7816 device.
void * hal_sync7816_open(sync7816_init_t *init)
Init sync7816 device.
int fm4428_read_byte(void *dev, uint32_t addr, int protect, uint8_t *rx_data)
Read one byte for fm4428 chip.
void hal_sync7816_stop(void *dev)
Send stop signal to device.
int fm4428_unlock(void *dev, uint8_t psc1, uint8_t psc2)
Unlock fm4428 chip for write.
int fm4442_read_cmd(void *dev, uint32_t cmd, uint32_t addr, uint32_t *rx_data, uint32_t rx_len)
Send read command for fm4442 chip.
int hal_sync7816_answer_to_rst(void *dev, uint32_t *pval)
Get answer to reset.
int fm4428_write_byte(void *dev, uint32_t addr, uint8_t data)
Write one byte for fm4428 chip.
int fm4442_write_cmd(void *dev, uint32_t cmd, uint32_t addr, uint8_t data)
Send write command for fm4442 chip.