Experiment: Queued Approach to I2C Device Driver
A Queued I2C Driver? There has been a large push at the PC & Server level lately for breaking software into small, container-based independent parcels. But container infrastructure for embedded computing is still in its infancy. So how can we improve software design methods for embedded computing using the tools we have available? I've always liked the simplicity and separation provided by message queues. One of the key benefits, to me, is the inherent synchronization - basing a software design around queues relieves a lot of concurrency problems and typically single-threads your access to critical resources. So I'm considering the idea of basing an I2C interface around a queue mechanism. An I2C part needing a software driver, say a real-time-clock, would implement the driver to do a register read by sending a queue message and waiting for a response. The firmware would initialize command and response queues, and start an I2C operations thread. Pros and Cons Before we discu...