|
Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Interface for the HX711 sensor. More...
#include "hx711.h"#include "mcu_periph/gpio.h"#include "mcu_periph/sys_time.h"#include "modules/core/abi.h"#include "modules/datalink/downlink.h"#include "modules/datalink/telemetry.h"#include <BOARD_CONFIG>Go to the source code of this file.
Data Structures | |
| struct | hx711_dev_t |
| struct | hx711_t |
Macros | |
| #define | HX711_DEVICES_NB 4 |
| #define | HX711_GAIN 1 |
| #define | HX711_PWM_FREQUENCY 6000000 |
| #define | HX711_DEVICES {} |
| #define | HX711_FORCE_SENSOR_ID ABI_BROADCAST |
| #define | HX711_DEBUG false |
| #define | HX711_PERIOD (HX711_PWM_FREQUENCY / 50000) |
Functions | |
| static void | pwmpcb (PWMDriver *pwmp) |
| Callback on the falling edge of the clock signal. | |
| void | hx711_init (void) |
| void | hx711_event (void) |
| Start a measurement and publish the results when possible. | |
Variables | |
| float | hx711_meas_time = 0 |
| static volatile struct hx711_t | hx711 |
| static PWMConfig | pwmcfg |
Interface for the HX711 sensor.
Definition in file hx711.c.
| struct hx711_dev_t |
| struct hx711_t |
| Data Fields | ||
|---|---|---|
| volatile bool | busy | |
| struct hx711_dev_t | devices[HX711_DEVICES_NB] | |
| volatile bool | measurement_ready | |
| volatile uint8_t | read_bit_idx | |
| #define HX711_DEVICES_NB 4 |
Definition at line 37 of file hx711.c.
Referenced by hx711_event(), hx711_init(), and pwmpcb().
| #define HX711_FORCE_SENSOR_ID ABI_BROADCAST |
Definition at line 53 of file hx711.c.
Referenced by hx711_event().
| #define HX711_PERIOD (HX711_PWM_FREQUENCY / 50000) |
Definition at line 65 of file hx711.c.
Referenced by hx711_event().
| void hx711_event | ( | void | ) |
Start a measurement and publish the results when possible.
Definition at line 135 of file hx711.c.
References DefaultChannel, DefaultDevice, get_sys_time_float(), get_sys_time_usec(), gpio_get(), hx711, HX711_DEVICES_NB, HX711_FORCE_SENSOR_ID, hx711_meas_time, HX711_PERIOD, and pprzlog_tp.
| void hx711_init | ( | void | ) |
Definition at line 110 of file hx711.c.
References gpio_setup_input(), gpio_setup_pin_af(), hx711, HX711_DEVICES_NB, pwmcfg, and pwmpcb().
|
static |
Callback on the falling edge of the clock signal.
Definition at line 197 of file hx711.c.
References dev, gpio_get(), hx711, HX711_DEVICES_NB, and HX711_GAIN.
|
static |
Definition at line 85 of file hx711.c.
Referenced by hx711_event(), hx711_init(), and pwmpcb().
| float hx711_meas_time = 0 |
Definition at line 67 of file hx711.c.
Referenced by hx711_event().
|
static |
Definition at line 94 of file hx711.c.
Referenced by hx711_init().