7 static const char *
const TAG =
"tca9548a";
27 ESP_LOGCONFIG(TAG,
"Setting up TCA9548A...");
30 ESP_LOGE(TAG,
"TCA9548A failed");
34 ESP_LOGD(TAG,
"Channels currently open: %d", status);
37 ESP_LOGCONFIG(TAG,
"TCA9548A:");
42 if (this->is_failed())
45 uint8_t channel_val = 1 << channel;
46 return this->
write(&channel_val, 1);
51 ESP_LOGE(TAG,
"Failed to disable all channels.");
52 this->status_set_error();
void disable_all_channels()
the WriteBuffer structure stores a pointer to a write buffer and its length
i2c::ErrorCode writev(uint8_t address, i2c::WriteBuffer *buffers, size_t cnt, bool stop) override
void dump_config() override
the ReadBuffer structure stores a pointer to a read buffer and its length
virtual ErrorCode writev(uint8_t address, WriteBuffer *buffers, size_t cnt)
TCA9548AComponent * parent_
No error found during execution of method.
I2CBus * bus_
pointer to I2CBus instance
virtual ErrorCode read(uint8_t address, uint8_t *buffer, size_t len)
Creates a ReadBuffer and calls the virtual readv() method to read bytes into this buffer...
virtual ErrorCode write(uint8_t address, const uint8_t *buffer, size_t len)
Implementation of SPI Controller mode.
i2c::ErrorCode switch_to_channel(uint8_t channel)
i2c::ErrorCode readv(uint8_t address, i2c::ReadBuffer *buffers, size_t cnt) override
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
call method to a not initialized bus
virtual ErrorCode readv(uint8_t address, ReadBuffer *buffers, size_t count)=0
This virtual method reads bytes from an I2CBus into an array of ReadBuffer.