Application handler for i2c events.
Note: these functions will be called on an interrupt context.
Public Member Functions | |
virtual bool | OnStartRead () |
virtual bool | OnStartWrite () |
virtual bool | OnWrite (ConstByteSpan data) |
virtual Result< ConstByteSpan > | OnRead () |
virtual bool | OnStop () |
|
inlinevirtual |
Called when data is needed from the bus.
The responder implementation is responsible for handling hardware that doesn't support a hardware cache. In those cases follow-up interrupts for reading the next byte should consume the next byte from the original span until all the bytes have been consumed. At which point this function will be called again.
Reimplemented in pw::i2c::test::ResponderEventsForTest.
|
inlinevirtual |
Called when a read start condition is seen.
Reimplemented in pw::i2c::test::ResponderEventsForTest.
|
inlinevirtual |
Called when a write start condition is seen.
Reimplemented in pw::i2c::test::ResponderEventsForTest.
|
inlinevirtual |
Called when the stop condition is received.
Reimplemented in pw::i2c::test::ResponderEventsForTest.
|
inlinevirtual |
Called when data is available on the bus.
Depending on the IC, some buses have hardware caches so they will call this function once with a few bytes while others will call this once per byte. Either way, the write is not considered complete until the stop condition is called.
Reimplemented in pw::i2c::test::ResponderEventsForTest.