|
| bool | generalCall (const uint8_t *data, const size_t len) |
| | General call for I2C.
|
| |
| virtual std::string | debugInfo () const |
| | Output information for debug.
|
| |
|
|
|
| Component (const uint8_t addr=0x00) |
| |
|
| Component (const Component &)=delete |
| |
|
| Component (Component &&) noexcept=default |
| |
|
|
|
Component & | operator= (const Component &)=delete |
| |
|
Component & | operator= (Component &&) noexcept=default |
| |
|
| component_config_t | component_config () const |
| | Gets the common configurations in each unit.
|
| |
| void | component_config (const component_config_t &cfg) |
| | Set the common configurations in each unit.
|
| |
|
| virtual bool | begin () |
| | Begin unit.
|
| |
| virtual void | update (const bool force=false) |
| | Update unit.
|
| |
|
| const char * | deviceName () const |
| | Gets the device name.
|
| |
| types::uid_t | identifier () const |
| | Gets the identifier.
|
| |
| types::attr_t | attribute () const |
| | Gets the attributes.
|
| |
| types::category_t | category () const |
| | Gets the category.
|
| |
| uint32_t | order () const |
| | Gets the registered order (== 0 means not yet)
|
| |
| int16_t | channel () const |
| | Gets the channel if connected to another unit.
|
| |
| bool | isRegistered () const |
| | Is the unit registered with the manager?
|
| |
| uint8_t | address () const |
| | Address used to I2C access the device.
|
| |
| Adapter * | adapter () const |
| | Gets the access adapter.
|
| |
| template<class T > |
| auto | asAdapter (const Adapter::Type t) -> typename std::remove_cv< typename std::remove_pointer< T >::type >::type * |
| | Gets the access adapter cast to the specified type.
|
| |
| template<class T > |
| auto | asAdapter (const Adapter::Type t) const -> const typename std::remove_cv< typename std::remove_pointer< T >::type >::type * |
| | Gets the access adapter cast to the specified type (const overload)
|
| |
|
| bool | canAccessI2C () const |
| | Can the unit access via I2C?
|
| |
| bool | canAccessGPIO () const |
| | Can the unit access via GPIO?
|
| |
| bool | canAccessUART () const |
| | Can the unit access via UART?
|
| |
| bool | canAccessSPI () const |
| | Can the unit access via SPI?
|
| |
|
| bool | inPeriodic () const |
| | In periodic measurement?
|
| |
| bool | updated () const |
| | Periodic measurement data updated?
|
| |
| types::elapsed_time_t | updatedMillis () const |
| | Time elapsed since start-up when the measurement data was updated in update()
|
| |
| types::elapsed_time_t | interval () const |
| | Gets the periodic measurement interval.
|
| |
|
| virtual bool | assign (TwoWire &wire) |
| | Assign TwoWire as the communication bus.
|
| |
| virtual bool | assign (i2c_master_bus_handle_t bus) |
| | Assign I2C master bus (ESP-IDF native driver)
|
| |
| virtual bool | assign (const i2c_port_t port, const gpio_num_t sda, const gpio_num_t scl) |
| | Assign I2C (ESP-IDF legacy driver, pre-installed port)
|
| |
| virtual bool | assign (m5::I2C_Class &i2c) |
| | Assign I2C_Class as the communication bus.
|
| |
|
| virtual bool | assign (const int8_t rx_pin, const int8_t tx_pin) |
| | Assign GPIO pins as the communication bus.
|
| |
|
| virtual bool | assign (HardwareSerial &serial) |
| | Assign HardwareSerial as the communication bus.
|
| |
| virtual bool | assign (const uart_port_t uart_num) |
| | Assign UART (ESP-IDF native driver, pre-installed port)
|
| |
|
| virtual bool | assign (SPIClass &spi, const SPISettings &settings) |
| | Assign SPIClass as the communication bus.
|
| |
| virtual bool | assign (spi_device_handle_t handle, const gpio_num_t cs=GPIO_NUM_NC) |
| | Assign SPI device handle (ESP-IDF native driver, borrowed)
|
| |
|
| virtual bool | assign (m5::hal::bus::Bus *bus) |
| | Assign m5::hal::bus as the communication bus.
|
| |
|
- Note
- For daisy-chaining units such as hubs
|
| bool | hasParent () const |
| | Has parent unit?
|
| |
| bool | hasSiblings () const |
| | Are there any other devices connected to the same parent unit besides yourself?
|
| |
| bool | hasChildren () const |
| | Are there other devices connected to me?
|
| |
| size_t | childrenSize () const |
| | Number of units connected to me.
|
| |
| bool | existsChild (const uint8_t ch) const |
| | Is there another unit connected to the specified channel?
|
| |
| Component * | parent () |
| | Gets the parent unit.
|
| |
| Component * | child (const uint8_t channel) const |
| | Gets the device connected to the specified channel.
|
| |
| bool | add (Component &c, const int16_t channel) |
| | Connect the unit to the specified channel.
|
| |
| bool | selectChannel (const uint8_t ch=8) |
| | Select valid channel if exists.
|
| |
|
|
m5::hal::error::error_t | readWithTransaction (uint8_t *data, const size_t len) |
| | Read any data with transaction.
|
| |
|
template<typename Reg > |
| bool | readRegister (const Reg reg, uint8_t *rbuf, const size_t len, const uint32_t delayMillis, const bool stop=true) |
| | Read any data with transaction from register.
|
| |
|
template<typename Reg > |
| bool | readRegister8 (const Reg reg, uint8_t &result, const uint32_t delayMillis, const bool stop=true) |
| | Read byte with transaction from register.
|
| |
|
template<typename Reg > |
| bool | readRegister16BE (const Reg reg, uint16_t &result, const uint32_t delayMillis, const bool stop=true) |
| | Read word in big-endian order with transaction from register.
|
| |
|
template<typename Reg > |
| bool | readRegister16LE (const Reg reg, uint16_t &result, const uint32_t delayMillis, const bool stop=true) |
| | Read word in little-endian order with transaction from register.
|
| |
|
template<typename Reg > |
| bool | readRegister32BE (const Reg reg, uint32_t &result, const uint32_t delayMillis, const bool stop=true) |
| | Read dword in big-endian order with transaction from register.
|
| |
|
template<typename Reg > |
| bool | readRegister32LE (const Reg reg, uint32_t &result, const uint32_t delayMillis, const bool stop=true) |
| | Read dword in little-endian order with transaction from register.
|
| |
|
m5::hal::error::error_t | writeWithTransaction (const uint8_t *data, const size_t len, const bool stop=true) |
| | Write any data with transaction.
|
| |
|
template<typename Reg > |
| m5::hal::error::error_t | writeWithTransaction (const Reg reg, const uint8_t *data, const size_t len, const bool stop=true) |
| | Write any data with transaction to register.
|
| |
|
template<typename Reg > |
| bool | writeRegister (const Reg reg, const uint8_t *buf=nullptr, const size_t len=0U, const bool stop=true) |
| | Write any data with transaction to register.
|
| |
|
template<typename Reg > |
| bool | writeRegister8 (const Reg reg, const uint8_t value, const bool stop=true) |
| | Write byte with transaction to register.
|
| |
|
template<typename Reg > |
| bool | writeRegister16BE (const Reg reg, const uint16_t value, const bool stop=true) |
| | Write word in big-endian order with transaction to register.
|
| |
|
template<typename Reg > |
| bool | writeRegister16LE (const Reg reg, const uint16_t value, const bool stop=true) |
| | Write word in little-endian order with transaction to register.
|
| |
|
template<typename Reg > |
| bool | writeRegister32BE (const Reg reg, const uint32_t value, const bool stop=true) |
| | Write dword in big-endian order with transaction to register.
|
| |
|
template<typename Reg > |
| bool | writeRegister32LE (const Reg reg, const uint32_t value, const bool stop=true) |
| | Write dword in little-endian order with transaction to register.
|
| |
Base class of unit component.