Firmware-810 Message-126

From I-CubeX Wiki
Jump to: navigation, search

I2C WRITE (126, 7Eh)

The I2C WRITE message is a copied reply from the I2C WRITE command. This message indicates that the I2C device received and acknowledged the I2C WRITE command sent to its I2C address. The [BODY] of the I2C WRITE message indicates the I2C address of the device, the register number and the data bytes transferred to the device.

The I2C WRITE message [BODY] is:

00000xxx: xxx = [0..6]; I2C port number
0aaaaaaa: aaaaaa = [0..127]; I2C address of device
0000cccc: bbbbcccc = [0..255]; register number of device
0000eeee: ddddeeee = [0..255]; data to write to register bbbbcccc


240, 125, 0 {DEV}, 126 {I2C WRITE}, 05 {port number}, 56 {address of device}, 0, 3 {register 3 = 0*16+3}, 1, 2 {data byte 18 = 1*16+2}, 247 (F0h, 7Dh, 00h, 7Eh, 05h, 38h, 00h, 03h, 01h, 02h, F7h)

If the device responded to the provided I2C address “aaaaaaa” (I2C devices always acknowledge when it’s address is called) then the WiDig will respond with a I2C WRITE message identical to the I2C WRITE command sent. If there was no acknowledgement from the device within 100 ms (eg. wrong address or device not present) then the WiDig will respond with an I2C NO RESPONSE message (F0h, 00h, 7Bh, 05h, 38h, F7h). If the I2C port on the WiDig was not opened the WiDig will respond with a I2C PORT “port not opened” message (F0h 7Dh 00h 7Dh xx F7h, where xx is the requested port).