16#ifndef M5_UNIT_UNIFIED_HPP
17#define M5_UNIT_UNIFIED_HPP
21#if defined(ESP_PLATFORM) && !defined(M5_UNIT_UNIFIED_USING_RMT_V2)
22#include <driver/rmt.h>
27#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
53 using container_type = std::vector<Component*>;
58 UnitUnified() =
default;
59 UnitUnified(
const UnitUnified&) =
delete;
60 UnitUnified(UnitUnified&&) noexcept = default;
66 UnitUnified& operator=(const UnitUnified&) = delete;
68 UnitUnified& operator=(UnitUnified&&) noexcept = default;
73#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
82#if defined(DOXYGEN_PROCESS) || (defined(ESP_PLATFORM) && __has_include(<driver/i2c_master.h>))
100 bool add(
Component& u, i2c_master_bus_handle_t bus,
const i2c_port_t port,
const gpio_num_t sda,
101 const gpio_num_t scl);
103#if defined(DOXYGEN_PROCESS) || (defined(ESP_PLATFORM) && !__has_include(<driver/i2c_master.h>))
112 bool add(
Component& u,
const i2c_port_t port,
const gpio_num_t sda,
const gpio_num_t scl);
123#if defined(ESP_PLATFORM) || defined(DOXYGEN_PROCESS)
140#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
149#if defined(ESP_PLATFORM) || defined(DOXYGEN_PROCESS)
163#if defined(ARDUINO) || defined(DOXYGEN_PROCESS)
173#if defined(ESP_PLATFORM) || defined(DOXYGEN_PROCESS)
182 bool add(
Component& u, spi_device_handle_t handle,
const gpio_num_t cs = GPIO_NUM_NC);
206 void update(
const bool force =
false);
216 std::string make_unit_info(
const Component* u,
const uint8_t indent = 0)
const;
219 container_type _units{};
222 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:321
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:299
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:311
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, const int8_t rx_pin, const int8_t tx_pin)
Add unit to be managed (GPIO)
bool add(Component &u, i2c_master_bus_handle_t bus, const i2c_port_t port, const gpio_num_t sda, const gpio_num_t scl)
Adding unit to be managed (I2C, ESP-IDF native driver, with the bus port and pins)
bool add(Component &u, TwoWire &wire)
Add unit to be managed (I2C via TwoWire)
Top level namespace of M5Stack.
Definition test_helper.hpp:20