40 #include "pprzlink/messages.h"
44#if DOWNLINK && !defined(SPA06_SYNC_SEND)
50 #define SPA06_USE_SPI FALSE
56#ifndef SPA06_SLAVE_ADDR
57 #define SPA06_SLAVE_ADDR SPA06_I2C_ADDR
61#ifndef SPA06_SLAVE_IDX
62 #define SPA06_SLAVE_IDX SPI_SLAVE0
73#if DOWNLINK && !defined(SPA06_SYNC_SEND)
109#if DOWNLINK && !defined(SPA06_SYNC_SEND)
142#if defined(SPA06_SYNC_SEND)
Main include for ABI (AirBorneInterface).
#define BARO_SPA_SENDER_ID
bool baro_spa06_alt_valid
true once the first valid sample has been processed
void baro_spa06_event(void)
Process finished bus transactions and publish new measurements.
float baro_spa06_alt
ISA pressure altitude of the last sample [m].
#define SPA06_SLAVE_ADDR
Default I2C slave address (SDO low); override with SPA06_I2C_ADDR_ALT for SDO high.
static void send_baro_spa_data(struct transport_tx *trans, struct link_device *dev)
Periodic telemetry: report the latest barometer data.
static float baro_spa06_press
last compensated pressure [Pa]
void baro_spa06_periodic(void)
Drive the sensor state machine (module periodic hook, 25Hz)
void baro_spa06_init(void)
Bind the driver to the configured bus and register telemetry.
struct spa06_t baro_spa06
The barometer driver instance.
#define SPA06_SLAVE_IDX
Default SPI slave select index, only used when SPA06_USE_SPI is TRUE.
static float baro_spa06_temp
last sensor temperature [deg Celcius]
Module glue for the Goertek SPA06-003 / SPL06-001 barometer.
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
Common code for AP and FBW telemetry.
static struct uart_periph * dev
static float pprz_isa_altitude_of_pressure(float pressure)
Get absolute altitude from pressure (using simplified equation).
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
Paparazzi atmospheric pressure conversion utilities.
void spa06_init(struct spa06_t *spa)
Initialize the spa06 sensor instance.
void spa06_event(struct spa06_t *spa)
Should be called in the event thread.
void spa06_periodic(struct spa06_t *spa)
Should be called periodically to request sensor readings.
float pressure
pressure in Pascal
volatile bool data_available
data ready flag
float temperature
temperature in deg Celcius
int32_t raw_pressure
uncompensated pressure
enum spa06_bus_t bus
The communication bus used to connect the device SPI/I2C.
int32_t raw_temperature
uncompensated temperature
int16_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint16_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.