How am I suppose to ReadI2C() from a sub-address?
I am using a peripheral device with a single address and an array of internal addressable registers that I should be able to individually WriteI2C() and ReadI2C(). I have no problem with WriteI2C() as the function takes first argument as the device address, while the second argument is set to 2. The first byte is interpreted as a sub-address and the second byte is the informaition written into this sub-address.
However, this approach doesn’t work with ReadI2C() as the first transfer becomes the read from the address instead of required selection of a sub-address.
Is this a conceptual problem or I am doing something wrong?
Btw, in order to WriteI2C() correctly you need shift the actuall address right by one bit prior to passing it to the WriteI2C() as the first argument.
Please help with ReadI2C(,)