From b4ecd612f7184cbf23d83ef78b0ccb5ed2c318e3 Mon Sep 17 00:00:00 2001 From: Tomasz Moń Date: Sat, 10 Jul 2021 08:56:32 +0200 Subject: Sansa Connect: Use deviceid in USB Serial Number Atmel AT88SC6416C CryptoMemory is almost I2C compatible. The device is connected to bitbanged I2C bus shared with compliant I2C devices. Change-Id: Iec54702db1bdfb93c01291eef18ec60391c63b16 --- firmware/export/generic_i2c.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'firmware/export/generic_i2c.h') diff --git a/firmware/export/generic_i2c.h b/firmware/export/generic_i2c.h index f71736acf0..9fdba26836 100644 --- a/firmware/export/generic_i2c.h +++ b/firmware/export/generic_i2c.h @@ -49,5 +49,15 @@ int i2c_write_data(int bus_index, int bus_address, int address, int i2c_read_data(int bus_index, int bus_address, int address, unsigned char* buf, int count); +/* Special function for devices that can appear on I2C bus but do not + * comply to I2C specification. Such devices include AT88SC6416C crypto + * memory. To read data from AT88SC6416C, a write I2C transaction starts, + * 3 bytes are written and then, in the middle of transaction, the device + * starts sending data. + */ +int i2c_write_read_data(int bus_index, int bus_address, + const unsigned char* buf_write, int count_write, + unsigned char* buf_read, int count_read); + #endif /* _GEN_I2C_ */ -- cgit v1.2.3