7static const char *
const TAG =
"hx711";
19 LOG_SENSOR(
"",
"HX711",
this);
21 LOG_PIN(
" SCK Pin: ", this->
sck_pin_);
22 LOG_UPDATE_INTERVAL(
this);
27 int32_t value =
static_cast<int32_t
>(result);
28 ESP_LOGD(TAG,
"'%s': Got value %" PRId32, this->
name_.
c_str(), value);
34 ESP_LOGW(TAG,
"HX711 is not ready for new measurements yet!");
44 for (uint8_t i = 0; i < 24; i++) {
53 for (uint8_t i = 0; i < static_cast<uint8_t>(this->
gain_); i++) {
63 ESP_LOGW(TAG,
"HX711 DOUT pin not high after reading (data 0x%" PRIx32
")!", data);
70 if (data & 0x800000ULL) {
71 data |= 0xFF000000ULL;
74 if (result !=
nullptr)
void status_set_warning()
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
bool read_sensor_(uint32_t *result)
void dump_config() override
void publish_state(float state)
Publish a new state to the front-end.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)