|
M5UnitUnified 0.5.5 git rev:bf711f3
|
For managing and leading units. More...
#include <M5UnitUnified.hpp>
Public Types | |
| using | container_type = std::vector<Component*> |
Public Member Functions | |
| bool | begin () |
| Begin all units under management. | |
| void | update (const bool force=false) |
| Update all units under management. | |
| std::string | debugInfo () const |
| Output information for debug. | |
Constructor | |
| |
| UnitUnified (const UnitUnified &)=delete | |
| UnitUnified (UnitUnified &&) noexcept=default | |
Assignment | |
| |
| UnitUnified & | operator= (const UnitUnified &)=delete |
| UnitUnified & | operator= (UnitUnified &&) noexcept=default |
Add unit(I2C) | |
| bool | add (Component &u, TwoWire &wire) |
| Add unit to be managed (I2C via TwoWire) | |
| bool | add (Component &u, i2c_master_bus_handle_t bus) |
| Adding unit to be managed (I2C, ESP-IDF native driver) | |
| 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, m5::I2C_Class &i2c) |
| Add unit to be managed (I2C via I2C_Class) | |
Add unit(GPIO) | |
| bool | add (Component &u, const int8_t rx_pin, const int8_t tx_pin) |
| Add unit to be managed (GPIO) | |
Add unit(UART) | |
| 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) | |
Add unit(SPI) | |
| bool | add (Component &u, SPIClass &spi, const SPISettings &settings) |
| Add unit to be managed (SPI) | |
| 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) | |
Add unit(M5HAL) | |
| bool | add (Component &u, m5::hal::bus::Bus *bus) |
| Add unit to be managed (M5HAL bus) | |
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 {} |
For managing and leading units.
| bool m5::unit::UnitUnified::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)
| u | Unit Component |
| port | I2C port (driver must be installed beforehand via i2c_param_config / i2c_driver_install) |
| sda | SDA GPIO |
| scl | SCL GPIO |
| bool m5::unit::UnitUnified::add | ( | Component & | u, |
| const int8_t | rx_pin, | ||
| const int8_t | tx_pin ) |
Add unit to be managed (GPIO)
| u | Unit Component |
| rx_pin | Pin number to be used for RX |
| tx_pin | Pin number to be used for TX |
| bool m5::unit::UnitUnified::add | ( | Component & | u, |
| const uart_port_t | uart_num ) |
Adding unit to be managed (UART, ESP-IDF native driver)
| u | Unit Component |
| uart_num | UART port number (the driver must be installed beforehand via uart_driver_install / uart_param_config / uart_set_pin) |
| bool m5::unit::UnitUnified::add | ( | Component & | u, |
| HardwareSerial & | serial ) |
Add unit to be managed (UART)
| u | Unit Component |
| serial | HardwareSerial to be used |
| bool m5::unit::UnitUnified::add | ( | Component & | u, |
| i2c_master_bus_handle_t | bus ) |
Adding unit to be managed (I2C, ESP-IDF native driver)
| u | Unit Component |
| bus | ESP-IDF I2C master bus handle |
| bool m5::unit::UnitUnified::add | ( | Component & | u, |
| m5::hal::bus::Bus * | bus ) |
Add unit to be managed (M5HAL bus)
| u | Unit Component |
| bus | Bus to be used |
| bool m5::unit::UnitUnified::add | ( | Component & | u, |
| m5::I2C_Class & | i2c ) |
Add unit to be managed (I2C via I2C_Class)
| u | Unit Component |
| i2c | I2C_Class to be used (e.g. M5.In_I2C) |
| bool m5::unit::UnitUnified::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)
| u | Unit Component |
| handle | ESP-IDF SPI device handle (create with spics_io_num = -1; init bus with SPI_DMA_DISABLED) |
| cs | CS GPIO controlled manually by this library. If GPIO_NUM_NC (default), uses Component::address() as the CS pin (same convention as Arduino SPI) |
| bool m5::unit::UnitUnified::add | ( | Component & | u, |
| SPIClass & | spi, | ||
| const SPISettings & | settings ) |
Add unit to be managed (SPI)
| u | Unit Component |
| spi | SPIClass to be used |
| settings | SPI settings to be applied |
| bool m5::unit::UnitUnified::add | ( | Component & | u, |
| TwoWire & | wire ) |
Add unit to be managed (I2C via TwoWire)
| u | Unit Component |
| wire | TwoWire to be used |
| bool m5::unit::UnitUnified::begin | ( | ) |
Begin all units under management.
| std::string m5::unit::UnitUnified::debugInfo | ( | ) | const |
Output information for debug.
| void m5::unit::UnitUnified::update | ( | const bool | force = false | ) |
Update all units under management.
| force | Forced communication for updates if true |