Skip to content

suggested functionality for I2Cdev::readWords #147

@mogar

Description

@mogar

I'm using I2Cdev with an IC that has a slightly non-standard interface. When reading from the chip, it expects a request in the form: chip address, register address, then data. It doesn't perform a STOP on the bus before reading in the data.

I2Cdev does everything I need, but when reading words it ends the connection after setting the register address and then starts a new connection, sends the chip address again, and then gets data.

I'd like to adapt the library by adding an optional stop input to readWords() that would change lines 418 and 419 to:

Wire.endTransmission(stop);
if (!stop) Wire.beginTransmission(devAddr);

If you'd be ok with this, I can open up a PR for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions