ESPHome 2025.5.0
Loading...
Searching...
No Matches
tca9548a.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome {
7namespace tca9548a {
8
9static const uint8_t TCA9548A_DISABLE_CHANNELS_COMMAND = 0x00;
10
11class TCA9548AComponent;
13 public:
14 void set_channel(uint8_t channel) { channel_ = channel; }
15 void set_parent(TCA9548AComponent *parent) { parent_ = parent; }
16
17 i2c::ErrorCode readv(uint8_t address, i2c::ReadBuffer *buffers, size_t cnt) override;
18 i2c::ErrorCode writev(uint8_t address, i2c::WriteBuffer *buffers, size_t cnt, bool stop) override;
19
20 protected:
21 uint8_t channel_;
23};
24
26 public:
27 void setup() override;
28 void dump_config() override;
29 float get_setup_priority() const override { return setup_priority::IO; }
30 void update();
31
32 i2c::ErrorCode switch_to_channel(uint8_t channel);
34
35 protected:
36 friend class TCA9548AChannel;
37};
38} // namespace tca9548a
39} // namespace esphome
uint8_t address
Definition bl0906.h:4
This Class provides the methods to read and write bytes from an I2CBus.
Definition i2c_bus.h:40
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
void set_parent(TCA9548AComponent *parent)
Definition tca9548a.h:15
i2c::ErrorCode writev(uint8_t address, i2c::WriteBuffer *buffers, size_t cnt, bool stop) override
Definition tca9548a.cpp:17
i2c::ErrorCode readv(uint8_t address, i2c::ReadBuffer *buffers, size_t cnt) override
Definition tca9548a.cpp:9
TCA9548AComponent * parent_
Definition tca9548a.h:22
void set_channel(uint8_t channel)
Definition tca9548a.h:14
i2c::ErrorCode switch_to_channel(uint8_t channel)
Definition tca9548a.cpp:41
float get_setup_priority() const override
Definition tca9548a.h:29
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
Definition i2c_bus.h:11
const float IO
For components that represent GPIO pins like PCF8573.
Definition component.cpp:17
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
the ReadBuffer structure stores a pointer to a read buffer and its length
Definition i2c_bus.h:24
the WriteBuffer structure stores a pointer to a write buffer and its length
Definition i2c_bus.h:30