|
Paparazzi UAS v7.0_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>
Include dependency graph for hx711.c: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 |
| Data Fields | ||
|---|---|---|
| uint16_t | data_pin | |
| ioportid_t | data_port | |
| int32_t | measurement | |
| struct hx711_t |
Collaboration diagram for 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_FORCE_SENSOR_ID ABI_BROADCAST |
| #define HX711_PERIOD (HX711_PWM_FREQUENCY / 50000) |
Start a measurement and publish the results when possible.
Definition at line 135 of file hx711.c.
References hx711_t::busy, hx711_dev_t::data_pin, hx711_dev_t::data_port, DefaultChannel, DefaultDevice, hx711_t::devices, foo, get_sys_time_float(), get_sys_time_usec(), gpio_get(), hx711, HX711_DEVICES_NB, HX711_FORCE_SENSOR_ID, hx711_meas_time, HX711_PERIOD, hx711_dev_t::measurement, hx711_t::measurement_ready, pprzlog_tp, and hx711_t::read_bit_idx.
Here is the call graph for this function:Definition at line 110 of file hx711.c.
References hx711_t::busy, hx711_dev_t::data_pin, hx711_dev_t::data_port, hx711_t::devices, foo, gpio_setup_input(), gpio_setup_pin_af(), hx711, HX711_DEVICES_NB, hx711_t::measurement_ready, pwmcfg, pwmpcb(), and hx711_t::read_bit_idx.
Here is the call graph for this function:Callback on the falling edge of the clock signal.
Definition at line 197 of file hx711.c.
References hx711_t::busy, dev, hx711_t::devices, foo, gpio_get(), hx711, HX711_DEVICES_NB, HX711_GAIN, hx711_t::measurement_ready, and hx711_t::read_bit_idx.
Referenced by hx711_init().
Here is the call graph for this function:
Here is the caller graph for this function: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().