M5UnitUnified 0.4.4 git rev:306ddd5
Loading...
Searching...
No Matches
m5::unit::googletest::I2CComponentTestBase< U > Class Template Referenceabstract

UnitComponent derived class for testing (I2C) More...

#include <test_template.hpp>

Inheritance diagram for m5::unit::googletest::I2CComponentTestBase< U >:

Protected Member Functions

virtual void SetUp () override
 
virtual void TearDown () override
 
virtual bool begin ()
 
bool begin_with_wire (TwoWire &wire, uint32_t wnum=0)
 
bool begin_with_ex_i2c ()
 
bool begin_with_software_i2c (int8_t sda, int8_t scl)
 
virtual U * get_instance ()=0
 return m5::unit::Component-derived class instance
 

Protected Attributes

std::string ustr {}
 
std::unique_ptr< U > unit {}
 
m5::unit::UnitUnified Units
 

Detailed Description

template<typename U>
class m5::unit::googletest::I2CComponentTestBase< U >

UnitComponent derived class for testing (I2C)

Template Parameters
Um5::unit::Component-derived classes to be tested

Provides board-aware begin() with 3-branch logic:

  • NessoN1: SoftwareI2C via M5HAL (GROVE on port_b GPIO 5/4)
  • NanoC6: M5.Ex_I2C (avoids Wire/Ex_I2C dual-driver conflict)
  • Others: Wire (initialized internally via begin_with_wire())