by josh » Mon Mar 21, 2011 2:36 am
by josh
Mon Mar 21, 2011 2:36 am
hellu wrote:Is 0x30 a valid address for a slave device?
If slave device is 7-bit adrress, set RoBoIO.i2c0master_StartN(0x30, RoBoIO.I2C_WRITE, 1).
If slave device is 8-bit adrress, set RoBoIO.i2c0master_StartN(0x30>>1, RoBoIO.I2C_WRITE, 1).
Because the function RoBoIO.i2c0master_StartN sends (7-bit address) + (write/read bit), the slave device recieve (address << 1) + (0/1) in fact.
hellu wrote:Is 0x30 a valid address for a slave device?
If slave device is 7-bit adrress, set RoBoIO.i2c0master_StartN(0x30, RoBoIO.I2C_WRITE, 1).
If slave device is 8-bit adrress, set RoBoIO.i2c0master_StartN(0x30>>1, RoBoIO.I2C_WRITE, 1).
Because the function RoBoIO.i2c0master_StartN sends (7-bit address) + (write/read bit), the slave device recieve (address << 1) + (0/1) in fact.