kplindegaard / smbus2

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

Further smbus extensions #39

Closed kungpfui closed 5 years ago

kungpfui commented 5 years ago

Hi Karl-Petter

I've extended your smbus2 class by some functionality which was, in my opinion, missing. It would be nice to see them all or partly in your base repository.

What I've done:

What do you think? Good ideas or bad ideas?

Stefan

kungpfui commented 5 years ago

Hi Karl-Petter,

Regarding i2c_read and i2c_write: I trust in comments ... most of the time. When there is no 32 bytes limit in .i2c_rdwr() there is, also in my opinion, no rational reason for additional read/write functions.

Regarding the perfomance: I made a comparision with a 32kbit EEPROM which I had by hand. There is a measureable difference but it's negliable. My old Raspi 1 needed with i2c_rdwr ~400ms to readout and return the whole EEPROM. Write/Read were slightly quicker (~370ms). So no big deal and the measured times are reasonable as well. I2C is running at 100kbit/s.

Keep up the great work, Stefan