Cosa
Cosa copied to clipboard
TWI: Improve asynchronous mode
Current implementation will synchronize with driver on twi.end(). An Event handler is possible but could be a callback to the driver instead which would be responsible for events in asynchronous mode.
The TWI::Driver class would be extended with a new virtual member function on_completion() which is called by the TWI state machine. The default implementation would do an event push if a handler is defined.
Initial refactoring; see commit https://github.com/mikaelpatel/Cosa/commit/173c3ebaa483d09acefb62df920bc6b064bf4420.