C/C++ API Reference
Loading...
Searching...
No Matches
pw::i2c::test::NativeResponderTestInterface Class Referenceabstract

Overview

This interface defines the contract that a backend-specific test harness (NativeResponderTest) must implement to be used with the generic pw::i2c::Responder tests.

Inheritance diagram for pw::i2c::test::NativeResponderTestInterface:
pw::unit_test::internal::Test

Public Member Functions

virtual ResponderGetResponder ()=0
 
virtual Status SimulateInitiatorWrite (ConstByteSpan write_data, bool send_stop)=0
 
virtual Status SimulateInitiatorRead (ByteSpan buffer, bool send_stop)=0
 
- Public Member Functions inherited from pw::unit_test::internal::Test
 Test (const Test &)=delete
 
Testoperator= (const Test &)=delete
 
void PigweedTestRun ()
 

Additional Inherited Members

- Static Public Member Functions inherited from pw::unit_test::internal::Test
static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 
static bool HasFailure ()
 
- Protected Member Functions inherited from pw::unit_test::internal::Test
virtual void SetUp ()
 
virtual void TearDown ()
 

Member Function Documentation

◆ GetResponder()

virtual Responder & pw::i2c::test::NativeResponderTestInterface::GetResponder ( )
pure virtual

Provides access to the backend-specific responder instance. The responder should have been configured with the callbacks provided to the NativeResponderTest constructor.

◆ SimulateInitiatorRead()

virtual Status pw::i2c::test::NativeResponderTestInterface::SimulateInitiatorRead ( ByteSpan  buffer,
bool  send_stop 
)
pure virtual

Simulates an I2C initiator reading data from the responder.

Parameters
bufferThe buffer into which the initiator will read data.
send_stopIf true, a STOP condition is simulated after the read.
Returns
  • OK: on success, all bytes were written.
  • Error code when not all the bytes could be written.

◆ SimulateInitiatorWrite()

virtual Status pw::i2c::test::NativeResponderTestInterface::SimulateInitiatorWrite ( ConstByteSpan  write_data,
bool  send_stop 
)
pure virtual

Simulates an I2C initiator writing data to the responder.

Parameters
write_dataThe data to be written by the initiator.
send_stopIf true, a STOP condition is simulated after the write.
Returns
  • OK: on successful simulation
  • Error status otherwise.

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