ESPHome  2024.12.2
hx711.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/hal.h"
6 
7 #include <cinttypes>
8 
9 namespace esphome {
10 namespace hx711 {
11 
12 enum HX711Gain : uint8_t {
16 };
17 
19  public:
20  void set_dout_pin(GPIOPin *dout_pin) { dout_pin_ = dout_pin; }
21  void set_sck_pin(GPIOPin *sck_pin) { sck_pin_ = sck_pin; }
23 
24  void setup() override;
25  void dump_config() override;
26  float get_setup_priority() const override;
27  void update() override;
28 
29  protected:
30  bool read_sensor_(uint32_t *result);
31 
35 };
36 
37 } // namespace hx711
38 } // namespace esphome
void set_gain(HX711Gain gain)
Definition: hx711.h:22
void update() override
Definition: hx711.cpp:27
bool read_sensor_(uint32_t *result)
Definition: hx711.cpp:35
This class simplifies creating components that periodically check a state.
Definition: component.h:283
void dump_config() override
Definition: hx711.cpp:20
AlsGain501 gain
void set_sck_pin(GPIOPin *sck_pin)
Definition: hx711.h:21
float get_setup_priority() const override
Definition: hx711.cpp:26
void setup() override
Definition: hx711.cpp:10
void set_dout_pin(GPIOPin *dout_pin)
Definition: hx711.h:20
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57