ESPHome 2026.8.0-dev
Loading...
Searching...
No Matches
ds248x_one_wire_bus.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome::ds248x {
7
8class DS248xComponent;
9
20 public:
21 void setup() override;
22 void dump_config() override;
23 float get_setup_priority() const override { return setup_priority::BUS - 1.0f; }
24
26 void set_parent(DS248xComponent *parent) { this->parent_ = parent; }
27
29 void set_channel(uint8_t channel) { this->channel_ = channel; }
30
32 uint8_t get_channel() const { return this->channel_; }
33
34 // OneWireBus interface implementation
35 int reset_int() override;
36 void write8(uint8_t val) override;
37 void write64(uint64_t val) override;
38 uint8_t read8() override;
39 uint64_t read64() override;
40
41 protected:
42 void reset_search() override;
43 uint64_t search_int() override;
44
46 bool ensure_channel_();
47
49 uint8_t channel_{0};
50
51 // Search state
52 uint64_t search_address_{0};
55};
56
57} // namespace esphome::ds248x
DS248x I2C-to-1-Wire Bridge Component.
Definition ds248x.h:59
OneWireBus implementation for DS248x I2C-to-1-Wire bridges.
float get_setup_priority() const override
void write64(uint64_t val) override
uint8_t get_channel() const
Get the channel number.
void set_parent(DS248xComponent *parent)
Set the parent DS248x component.
void set_channel(uint8_t channel)
Set the 1-Wire channel (0-7, only relevant for DS2482-800)
bool ensure_channel_()
Select the channel on the DS248x before any 1-Wire operation.
mopeka_std_values val[3]
constexpr float BUS
For communication buses like i2c/spi.
Definition component.h:39