kplindegaard / smbus2

A drop-in replacement for smbus-cffi/smbus-python in pure Python
MIT License
243 stars 68 forks source link

force single r/w operation #20

Closed nxet closed 6 years ago

nxet commented 6 years ago

read/write functions accept the parameter force, which is passed to _set_address. adds the new class variable _force_last to track the status and keep the ioctl call after the if statement.

tested on OPiZero + DSx RTC (shows up at 0xUU with i2cdetect). switching force mode, device address and register, all seemed to be working fine.

kplindegaard commented 6 years ago

@nxet Thanks! I'll update the patch version number and release+publish when I have time.