8 static const char *
const TAG =
"hx711";
11 ESP_LOGCONFIG(TAG,
"Setting up HX711 '%s'...", this->
name_.
c_str());
21 LOG_SENSOR(
"",
"HX711",
this);
23 LOG_PIN(
" SCK Pin: ", this->
sck_pin_);
24 LOG_UPDATE_INTERVAL(
this);
30 int32_t value =
static_cast<int32_t
>(result);
31 ESP_LOGD(TAG,
"'%s': Got value %" PRId32, this->
name_.
c_str(), value);
37 ESP_LOGW(TAG,
"HX711 is not ready for new measurements yet!");
47 for (uint8_t i = 0; i < 24; i++) {
56 for (uint8_t i = 0; i < static_cast<uint8_t>(this->
gain_); i++) {
66 ESP_LOGW(TAG,
"HX711 DOUT pin not high after reading (data 0x%" PRIx32
")!", data);
73 if (data & 0x800000ULL) {
74 data |= 0xFF000000ULL;
77 if (result !=
nullptr)
virtual void digital_write(bool value)=0
const float DATA
For components that import data from directly connected sensors like DHT.
void status_set_warning(const char *message="unspecified")
bool read_sensor_(uint32_t *result)
void dump_config() override
void status_clear_warning()
void publish_state(float state)
Publish a new state to the front-end.
float get_setup_priority() const override
virtual bool digital_read()=0
constexpr const char * c_str() const
Helper class to disable interrupts.
Implementation of SPI Controller mode.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)