ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
tca9548a.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome::tca9548a {
7
8static const uint8_t TCA9548A_DISABLE_CHANNELS_COMMAND = 0x00;
9
10class TCA9548AComponent;
12 public:
13 void set_channel(uint8_t channel) { channel_ = channel; }
14 void set_parent(TCA9548AComponent *parent) { parent_ = parent; }
15
16 i2c::ErrorCode write_readv(uint8_t address, const uint8_t *write_buffer, size_t write_count, uint8_t *read_buffer,
17 size_t read_count) override;
18
19 protected:
20 uint8_t channel_;
22};
23
25 public:
26 void setup() override;
27 void dump_config() override;
28 float get_setup_priority() const override { return setup_priority::IO; }
29 void update();
30
31 i2c::ErrorCode switch_to_channel(uint8_t channel);
33
34 protected:
35 friend class TCA9548AChannel;
36};
37} // namespace esphome::tca9548a
uint8_t address
Definition bl0906.h:4
This Class provides the methods to read and write bytes from an I2CBus.
Definition i2c_bus.h:29
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
void set_parent(TCA9548AComponent *parent)
Definition tca9548a.h:14
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
Definition tca9548a.cpp:8
TCA9548AComponent * parent_
Definition tca9548a.h:21
void set_channel(uint8_t channel)
Definition tca9548a.h:13
i2c::ErrorCode switch_to_channel(uint8_t channel)
Definition tca9548a.cpp:31
float get_setup_priority() const override
Definition tca9548a.h:28
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
Definition i2c_bus.h:12
constexpr float IO
For components that represent GPIO pins like PCF8573.
Definition component.h:39