OnionIoT/i2c-exp-driver

Omega I2C driver misses reading without defining register address

Closed this issue · 2 comments

foxel commented

Currently there is on readBytes(deviceAddr, addr, numBytes) -> [values] method.
It makes impossible to implement some I2C chip protocols. e.g. https://s3.amazonaws.com/controleverything.media/controleverything/Production%20Run%205/10_SI7006-A20_I2CS/Datasheets/Si7006-A20.pdf

There should be something like read(deviceAddr: int, numBytes: int) -> [values] or read(deviceAddr: int, [args]: int[], numBytes: int) -> [values]

Yes, this has been a rather frustrating discovery with the SI7020-A20 Temp/Humidity CE module as well.

foxel commented

I've successfully modified the code and created PR.

Compiled packages are available on https://www.dropbox.com/sh/p7mki5nbgyu1tcv/AABPC1HzA848MbEA9RpNiNNva?dl=0

One can install them with opkg install libonioni2c_0.4-2_mipsel_24kc.ipk pyOnionI2C_0.4-2_mipsel_24kc.ipk pyOmegaExpansion_0.4-2_mipsel_24kc.ipk liboniondebug_0.4-2_mipsel_24kc.ipk

Example using modified python library: https://gist.github.com/foxel/a163231293d7cf6f24831b363a91dfe5