Implements the pw::i2c::Responder interface using the Zephyr I2C target API.
This class allows a Pigweed I2C responder implementation to be used with a Zephyr I2C peripheral operating in target mode. It is marked final to ensure CONTAINER_OF remains safe.
Public Types | |
using | OnStartReadCallback = pw::Function< Status()> |
using | OnStartWriteCallback = pw::Function< Status()> |
using | OnWriteCallback = pw::Function< Status(ConstByteSpan)> |
using | OnReadCallback = pw::Function< Result< ByteSpan >()> |
using | OnStopCallback = pw::Function< Status()> |
Public Member Functions | |
ZephyrResponder (const ::device *zephyr_i2c_device, pw::i2c::Address address, ResponderEvents &events) | |
![]() | |
constexpr | Responder (Address address, ResponderEvents &events) |
Status | Enable () |
Status | Disable () |
Private Member Functions | |
Responder interface overrides | |
Status | DoEnable () override |
Implementation of Enable() | |
Status | DoDisable () override |
Implementation of Disable() | |
Additional Inherited Members | |
![]() | |
virtual Status | DoEnable ()=0 |
Implementation of Enable() | |
virtual Status | DoDisable ()=0 |
Implementation of Disable() | |
bool | OnStartRead () |
bool | OnStartWrite () |
bool | OnWrite (ConstByteSpan data) |
Result< ConstByteSpan > | OnRead () |
bool | OnStop () |
const Address & | address () const |
|
overrideprivatevirtual |
Implementation of Disable()
Implements pw::i2c::Responder.
|
overrideprivatevirtual |
Implementation of Enable()
Implements pw::i2c::Responder.