ESPHome 2025.5.2
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
hx711.h
Go to the documentation of this file.
1#pragma once
2
4#include "esphome/core/hal.h"
6
7#include <cinttypes>
8
9namespace esphome {
10namespace hx711 {
11
12enum 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
This class simplifies creating components that periodically check a state.
Definition component.h:301
float get_setup_priority() const override
Definition hx711.cpp:26
void set_sck_pin(GPIOPin *sck_pin)
Definition hx711.h:21
void setup() override
Definition hx711.cpp:10
void set_gain(HX711Gain gain)
Definition hx711.h:22
void set_dout_pin(GPIOPin *dout_pin)
Definition hx711.h:20
bool read_sensor_(uint32_t *result)
Definition hx711.cpp:35
void update() override
Definition hx711.cpp:27
void dump_config() override
Definition hx711.cpp:20
Base-class for all sensors.
Definition sensor.h:57
AlsGain501 gain
@ HX711_GAIN_64
Definition hx711.h:15
@ HX711_GAIN_128
Definition hx711.h:13
@ HX711_GAIN_32
Definition hx711.h:14
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7