Did I2C with Linux in the mid-90's so the dust is pretty thick and the rust is nice and brown. One thing that worked very well was to plan things out in advance rather than tinker-til-done.
I2C is first of all a serial connection so lots of the dancing one does with vanilla serial ports applies. Of course there are no modem signals to handshake. That happens in the I2C protocol itself. From what I remember, we started with COMx driver code and adapted. Today's USB is also serial and might be a better fit since COMx support has faded and so many things have USB connections and associated support.
We made a cable from I2C into the COM port on another computer. We watched what was happening with minicom or similar. Eventually, we built a small program that behaved according to our device spec. The "driver" would then talk to this bogus device until all of that worked. By that time, we had real device hardware and could sort the final details like timing there. We kept the COM port box as a spy on the serial data.
I'll tell you what I remember and help however I can.
~~~ 0;-Dan
|