ESPHome  2024.11.0
gpio_one_wire.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/hal.h"
6 
7 namespace esphome {
8 namespace gpio {
9 
11  public:
12  void setup() override;
13  void dump_config() override;
14  float get_setup_priority() const override { return setup_priority::BUS; }
15 
16  void set_pin(InternalGPIOPin *pin) {
17  this->t_pin_ = pin;
18  this->pin_ = pin->to_isr();
19  }
20 
21  bool reset() override;
22  void write8(uint8_t val) override;
23  void write64(uint64_t val) override;
24  uint8_t read8() override;
25  uint64_t read64() override;
26 
27  protected:
30  uint8_t last_discrepancy_{0};
31  bool last_device_flag_{false};
32  uint64_t address_;
33 
34  void reset_search() override;
35  uint64_t search_int() override;
36  void write_bit_(bool bit);
37  bool read_bit_();
38 };
39 
40 } // namespace gpio
41 } // namespace esphome
Copy of GPIOPin that is safe to use from ISRs (with no virtual functions)
Definition: gpio.h:66
mopeka_std_values val[4]
void write64(uint64_t val) override
const float BUS
For communication buses like i2c/spi.
Definition: component.cpp:16
uint64_t search_int() override
virtual ISRInternalGPIOPin to_isr() const =0
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
float get_setup_priority() const override
Definition: gpio_one_wire.h:14
void write8(uint8_t val) override
void set_pin(InternalGPIOPin *pin)
Definition: gpio_one_wire.h:16