ESPHome  2024.12.2
dallas_temp.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace dallas_temp {
9 
11  public:
12  void setup() override;
13  void update() override;
14  void dump_config() override;
15 
17  void set_resolution(uint8_t resolution) { this->resolution_ = resolution; }
18 
19  protected:
20  uint8_t resolution_;
21  uint8_t scratch_pad_[9] = {0};
22 
24  uint16_t millis_to_wait_for_conversion_() const;
25  bool read_scratch_pad_();
26  void read_scratch_pad_int_();
27  bool check_scratch_pad_();
28  float get_temp_c_();
29 };
30 
31 } // namespace dallas_temp
32 } // namespace esphome
void set_resolution(uint8_t resolution)
Set the resolution for this sensor.
Definition: dallas_temp.h:17
This class simplifies creating components that periodically check a state.
Definition: component.h:283
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57
uint16_t millis_to_wait_for_conversion_() const
Get the number of milliseconds we have to wait for the conversion phase.
Definition: dallas_temp.cpp:15