16#ifndef M5_UNIT_UNIFIED_HPP
17#define M5_UNIT_UNIFIED_HPP
21#if defined(M5_UNIT_UNIFIED_USING_RMT_V2)
23#include <driver/rmt.h>
28#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
54 using container_type = std::vector<Component*>;
59 UnitUnified() =
default;
60 UnitUnified(
const UnitUnified&) =
delete;
61 UnitUnified(UnitUnified&&) noexcept = default;
67 UnitUnified& operator=(const UnitUnified&) = delete;
69 UnitUnified& operator=(UnitUnified&&) noexcept = default;
74#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
83#if defined(DOXYGEN_PROCESS) || (defined(ESP_PLATFORM) && __has_include(<driver/i2c_master.h>))
92#if defined(DOXYGEN_PROCESS) || (defined(ESP_PLATFORM) && !__has_include(<driver/i2c_master.h>))
101 bool add(
Component& u,
const i2c_port_t port,
const gpio_num_t sda,
const gpio_num_t scl);
121 bool add(
Component& u,
const int8_t rx_pin,
const int8_t tx_pin);
126#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
135#if defined(ESP_PLATFORM) || defined(DOXYGEN_PROCESS)
149#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
159#if defined(ESP_PLATFORM) || defined(DOXYGEN_PROCESS)
168 bool add(
Component& u, spi_device_handle_t handle,
const gpio_num_t cs = GPIO_NUM_NC);
192 void update(
const bool force =
false);
202 std::string make_unit_info(
const Component* u,
const uint8_t indent = 0)
const;
205 container_type _units{};
208 static uint32_t _registerCount;
Main header of M5UnitComponent.
Base class of unit component.
bool add(Component &u, spi_device_handle_t handle, const gpio_num_t cs=GPIO_NUM_NC)
Adding unit to be managed (SPI, ESP-IDF native driver)
std::string debugInfo() const
Output information for debug.
Definition M5UnitUnified.cpp:285
bool add(Component &u, i2c_master_bus_handle_t bus)
Adding unit to be managed (I2C, ESP-IDF native driver)
bool add(Component &u, SPIClass &spi, const SPISettings &settings)
Add unit to be managed (SPI)
bool begin()
Begin all units under management.
Definition M5UnitUnified.cpp:263
bool add(Component &u, HardwareSerial &serial)
Add unit to be managed (UART)
bool add(Component &u, const uart_port_t uart_num)
Adding unit to be managed (UART, ESP-IDF native driver)
void update(const bool force=false)
Update all units under management.
Definition M5UnitUnified.cpp:275
bool add(Component &u, const i2c_port_t port, const gpio_num_t sda, const gpio_num_t scl)
Adding unit to be managed (I2C, ESP-IDF legacy driver)
bool add(Component &u, TwoWire &wire)
Add unit to be managed (I2C via TwoWire)
Top level namespace of M5Stack.
Definition test_helper.hpp:20