7static const char *
const TAG =
"tca9548a";
10 uint8_t *read_buffer,
size_t read_count) {
21 ESP_LOGE(TAG,
"TCA9548A failed");
25 ESP_LOGD(TAG,
"Channels currently open: %d",
status);
28 ESP_LOGCONFIG(TAG,
"TCA9548A:");
36 uint8_t channel_val = 1 << channel;
37 return this->
write(&channel_val, 1);
42 ESP_LOGE(TAG,
"Failed to disable all channels.");
virtual void mark_failed()
Mark this component as failed.
void status_set_error(const char *message=nullptr)
virtual ErrorCode write_readv(uint8_t address, const uint8_t *write_buffer, size_t write_count, uint8_t *read_buffer, size_t read_count)=0
This virtual method writes bytes to an I2CBus from an array, then reads bytes into an array of ReadBu...
ErrorCode write(const uint8_t *data, size_t len) const
writes an array of bytes to a device using an I2CBus
I2CBus * bus_
pointer to I2CBus instance
ErrorCode read(uint8_t *data, size_t len) const
reads an array of bytes from the device using an I2CBus
i2c::ErrorCode write_readv(uint8_t address, const uint8_t *write_buffer, size_t write_count, uint8_t *read_buffer, size_t read_count) override
TCA9548AComponent * parent_
i2c::ErrorCode switch_to_channel(uint8_t channel)
void disable_all_channels()
void dump_config() override
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
@ ERROR_OK
No error found during execution of method.
@ ERROR_NOT_INITIALIZED
call method to a not initialized bus
Providing packet encoding functions for exchanging data with a remote host.