C/C++ API Reference
Loading...
Searching...
No Matches
pw::i2c::ZephyrResponder Class Referencefinal

Overview

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.

Inheritance diagram for pw::i2c::ZephyrResponder:
pw::i2c::Responder

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)
 
- Public Member Functions inherited from pw::i2c::Responder
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

- Protected Member Functions inherited from pw::i2c::Responder
virtual Status DoEnable ()=0
 Implementation of Enable()
 
virtual Status DoDisable ()=0
 Implementation of Disable()
 
bool OnStartRead ()
 
bool OnStartWrite ()
 
bool OnWrite (ConstByteSpan data)
 
Result< ConstByteSpanOnRead ()
 
bool OnStop ()
 
const Addressaddress () const
 

Member Function Documentation

◆ DoDisable()

Status pw::i2c::ZephyrResponder::DoDisable ( )
overrideprivatevirtual

Implementation of Disable()

Implements pw::i2c::Responder.

◆ DoEnable()

Status pw::i2c::ZephyrResponder::DoEnable ( )
overrideprivatevirtual

Implementation of Enable()

Implements pw::i2c::Responder.


The documentation for this class was generated from the following file: