ZotBins Core
Loading...
Searching...
No Matches
hx711.c File Reference
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <esp_timer.h>
#include <ets_sys.h>
#include <esp_idf_lib_helpers.h>
#include "hx711.h"
Include dependency graph for hx711.c:

Macros

#define CHECK(x)
 
#define CHECK_ARG(VAL)
 

Functions

esp_err_t hx711_init (hx711_t *dev)
 Initialize device.
 
esp_err_t hx711_power_down (hx711_t *dev, bool down)
 Set device power up/down.
 
esp_err_t hx711_set_gain (hx711_t *dev, hx711_gain_t gain)
 Set device gain and channel.
 
esp_err_t hx711_is_ready (hx711_t *dev, bool *ready)
 Check if device ready to send data.
 
esp_err_t hx711_wait (hx711_t *dev, size_t timeout_ms)
 Wait for device to become ready.
 
esp_err_t hx711_read_data (hx711_t *dev, int32_t *data)
 Read raw data from device.
 
esp_err_t hx711_read_average (hx711_t *dev, size_t times, int32_t *data)
 Read average data.
 

Detailed Description

ESP-IDF driver for HX711 24-bit ADC for weigh scales

Copyright (c) 2019 Ruslan V. Uss uncle.nosp@m.rus@.nosp@m.gmail.nosp@m..com

BSD Licensed as described in the file LICENSE

Macro Definition Documentation

◆ CHECK

#define CHECK ( x)
Value:
do { esp_err_t __; if ((__ = x) != ESP_OK) return __; } while (0)

◆ CHECK_ARG

#define CHECK_ARG ( VAL)
Value:
do { if (!(VAL)) return ESP_ERR_INVALID_ARG; } while (0)