M5UnitUnified 0.1.0 git rev:f196fcd
Loading...
Searching...
No Matches
m5::unit::UnitUnified Class Reference

For managing and leading units. More...

#include <M5UnitUnified.hpp>

Public Types

using container_type = std::vector<Component*>
 

Public Member Functions

bool begin ()
 Begin of all units under management.
 
void update (const bool force=false)
 Update of all units under management.
 
std::string debugInfo () const
 Output information for debug.
 
Constructor
Warning
COPY PROHIBITED
 UnitUnified (const UnitUnified &)=delete
 
 UnitUnified (UnitUnified &&) noexcept=default
 
Assignment
Warning
COPY PROHIBITED
UnitUnifiedoperator= (const UnitUnified &)=delete
 
UnitUnifiedoperator= (UnitUnified &&) noexcept=default
 
Add unit
bool add (Component &u, TwoWire &wire)
 Adding unit to be managed (I2C)
 
bool add (Component &u, const int8_t rx_pin, const int8_t tx_pin)
 Adding unit to be managed (GPIO)
 
bool add (Component &u, m5::hal::bus::Bus *bus)
 Adding unit to be managed (M5HAL)
 

Protected Member Functions

bool add_children (Component &u)
 
std::string make_unit_info (const Component *u, const uint8_t indent=0) const
 

Protected Attributes

container_type _units {}
 

Detailed Description

For managing and leading units.

Member Function Documentation

◆ add() [1/3]

bool m5::unit::UnitUnified::add ( Component & u,
const int8_t rx_pin,
const int8_t tx_pin )

Adding unit to be managed (GPIO)

Parameters
uUnit Component
rx_pinPin number to be used for RX
tx_pinPin number to be used for TX
Returns
True if successful

◆ add() [2/3]

bool m5::unit::UnitUnified::add ( Component & u,
m5::hal::bus::Bus * bus )

Adding unit to be managed (M5HAL)

Parameters
uUnit Component
busBus to be used
Returns
True if successful

◆ add() [3/3]

bool m5::unit::UnitUnified::add ( Component & u,
TwoWire & wire )

Adding unit to be managed (I2C)

Parameters
uUnit Component
wireTwoWire to be used
Returns
True if successful