InPlay API
Synchronous 7816 driver

HAL SYNC7816. More...

Functions

void * hal_sync7816_open (sync7816_init_t *init)
 Init sync7816 device. More...
 
void hal_sync7816_close (void *dev)
 Close sync7816 device. More...
 
void hal_sync7816_stop (void *dev)
 Send stop signal to device. More...
 
int hal_sync7816_answer_to_rst (void *dev, uint32_t *pval)
 Get answer to reset. More...
 
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. More...
 
int fm4428_read_byte (void *dev, uint32_t addr, int protect, uint8_t *rx_data)
 Read one byte for fm4428 chip. More...
 
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. More...
 
int fm4428_write_byte (void *dev, uint32_t addr, uint8_t data)
 Write one byte for fm4428 chip. More...
 
int fm4428_unlock (void *dev, uint8_t psc1, uint8_t psc2)
 Unlock fm4428 chip for write. More...
 
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. More...
 
int fm4442_write_cmd (void *dev, uint32_t cmd, uint32_t addr, uint8_t data)
 Send write command for fm4442 chip. More...
 

Detailed Description

HAL SYNC7816.

Function Documentation

◆ fm4428_read_byte()

int fm4428_read_byte ( void *  dev,
uint32_t  addr,
int  protect,
uint8_t *  rx_data 
)

Read one byte for fm4428 chip.

Parameters
[in]devSync7816 device struct
[in]addrAddress
[in]protect1 is protect, 0 is not protect.
[out]rx_dataData that read out from bus
Returns
0 if successful, otherwise failed

◆ fm4428_read_cmd()

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.

Parameters
[in]devSync7816 device struct
[in]cmdCommand
[in]addrAddress
[out]rx_dataData that read out from bus
[in]rx_lenRx bit length. Max value is 32 bit.
Returns
0 if successful, otherwise failed

◆ fm4428_unlock()

int fm4428_unlock ( void *  dev,
uint8_t  psc1,
uint8_t  psc2 
)

Unlock fm4428 chip for write.

Parameters
[in]devSync7816 device struct
[in]psc1psc1 code
[in]psc2psc2 code
Returns
0 if successful, otherwise failed

◆ fm4428_write_byte()

int fm4428_write_byte ( void *  dev,
uint32_t  addr,
uint8_t  data 
)

Write one byte for fm4428 chip.

Parameters
[in]devSync7816 device struct
[in]addrAddress
[in]dataData that write to bus
Returns
0 if successful, otherwise failed

◆ fm4428_write_cmd()

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.

Parameters
[in]devSync7816 device struct
[in]cmdCommand
[in]addrAddress
[in]dataData that write to bus
[in]wait_clkWait clock for operation finish
Returns
0 if successful, otherwise failed

◆ fm4442_read_cmd()

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.

Parameters
[in]devSync7816 device struct
[in]cmdCommand
[in]addrAddress
[out]rx_dataData that read out from bus
[in]rx_lenRx bit length. Max value is 16 bit.
Returns
0 if successful, otherwise failed

◆ fm4442_write_cmd()

int fm4442_write_cmd ( void *  dev,
uint32_t  cmd,
uint32_t  addr,
uint8_t  data 
)

Send write command for fm4442 chip.

Parameters
[in]devSync7816 device struct
[in]cmdCommand
[in]addrAddress
[in]dataData that write to bus
Returns
0 if successful, otherwise failed

◆ hal_sync7816_answer_to_rst()

int hal_sync7816_answer_to_rst ( void *  dev,
uint32_t *  pval 
)

Get answer to reset.

Parameters
[in]devsync7816 device struct
[out]pvaldata pointer of answer to reset
Returns
0 if successful, otherwise failed

◆ hal_sync7816_close()

void hal_sync7816_close ( void *  dev)

Close sync7816 device.

Parameters
[in]devsync7816 device struct
Returns
None

◆ hal_sync7816_open()

void* hal_sync7816_open ( sync7816_init_t *  init)

Init sync7816 device.

Parameters
[in]initInitial parameters, see sync7816_init_t
Returns
Sync7816 device struct, NUll if failed.

◆ hal_sync7816_stop()

void hal_sync7816_stop ( void *  dev)

Send stop signal to device.

Parameters
[in]devsync7816 device struct
Returns
None