Closed gen2thomas closed 1 year ago
That sounds like a great idea!
While rework of PCA9501 i2c driver (see #786 ), I found that all implementations of Read*Data() in digispark (and also in firmata) are wrong implemented, regarding to the Kernel specification and the implementation of sys-fs driver.
Read Byte (Comm==Register) S Addr Wr [A] Comm [A] Sr Addr Rd [A] [Data] NA P We have implemented in "ReadByteData()": S Addr Wr [A] Comm [A] P S Addr Rd [A] [Data] NA P
Read Word S Addr Wr [A] Comm [A] Sr Addr Rd [A] [DataLow] A [DataHigh] NA P Implemented in "ReadWordData()": S Addr Wr [A] Data [A] P S Addr Rd [A] [DataLow] A [DataHigh] NA P
In general most chips support both sequences, but unfortunately not all, e.g. PCA9501, which only support the "Read Byte".
At least the littlewire interface, used for digispark, support the skip of stop condition ("P"), so the change is generally no problem.
Hi @deadprogram , because I'm not familiar with firmata in general and with client "writes an arbitrary Sysex command to the microcontroller" in special, I'm just marked the wrong implemented commands with an TODO and will create a new issue for this special behavior.
part of release v2.0.0
According to the Kernel specification it should be possible to implement this function. The opposite "WriteBlockData()" is still implemented.
Following drivers could be simplified:
Some notes for support of block-read: