8static const char *
const TAG =
"hx711";
20 LOG_SENSOR(
"",
"HX711",
this);
22 LOG_PIN(
" SCK Pin: ", this->
sck_pin_);
23 LOG_UPDATE_INTERVAL(
this);
29 int32_t value =
static_cast<int32_t
>(result);
30 ESP_LOGD(TAG,
"'%s': Got value %" PRId32, this->
name_.
c_str(), value);
36 ESP_LOGW(TAG,
"HX711 is not ready for new measurements yet!");
46 for (uint8_t i = 0; i < 24; i++) {
55 for (uint8_t i = 0; i < static_cast<uint8_t>(this->
gain_); i++) {
65 ESP_LOGW(TAG,
"HX711 DOUT pin not high after reading (data 0x%" PRIx32
")!", data);
72 if (data & 0x800000ULL) {
73 data |= 0xFF000000ULL;
76 if (result !=
nullptr)
void status_set_warning(const char *message=nullptr)
void status_clear_warning()
virtual void digital_write(bool value)=0
virtual bool digital_read()=0
Helper class to disable interrupts.
constexpr const char * c_str() const
float get_setup_priority() const override
bool read_sensor_(uint32_t *result)
void dump_config() override
void publish_state(float state)
Publish a new state to the front-end.
const float DATA
For components that import data from directly connected sensors like DHT.
Providing packet encoding functions for exchanging data with a remote host.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)