SUB-20 I2C 10-bit address support
Posted: Sun Jun 13, 2010 8:15 am
SUB-20 I2C Master can support 10-bit I2C address mode. Let's see how.
sub_i2c_write
sub_i2c_read
- Master-transmitter transmits to slave-receiver with a 10-bit slave address. Transaction format [attachment=1]i2.jpg[/attachment] To generate such transaction you can run [code] /* Address Slave 0x355 */ #define SLAVE_ADDR_BITS98 0x03 #define SLAVE_ADDR_BITS70 0x55 rc = sub_i2c_write( hndl, 0xF8|SLAVE_ADDR_BITS98, SLAVE_ADDR_BITS70, 1, buf, BUF_SZ ); [/code]
- Master-receiver reads slave-transmitter with a 10-bit slave address. Transaction format [attachment=0]i22.jpg[/attachment] To generate such transaction you can run [code] /* Address Slave 0x355 */ #define SLAVE_ADDR_BITS98 0x03 #define SLAVE_ADDR_BITS70 0x55 rc = sub_i2c_read( hndl, 0xF8|SLAVE_ADDR_BITS98, SLAVE_ADDR_BITS70, 1, buf, BUF_SZ ); [/code]
sub_i2c_write
sub_i2c_read