Paparazzi UAS v7.1_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
baro_spa06.h File Reference

Module glue for the Goertek SPA06-003 / SPL06-001 barometer. More...

+ Include dependency graph for baro_spa06.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void baro_spa06_init (void)
 Bind the driver to the configured bus and register telemetry (module init hook)
 
void baro_spa06_periodic (void)
 Drive the sensor state machine (module periodic hook)
 
void baro_spa06_event (void)
 Process finished bus transactions and publish new measurements (module event hook)
 

Variables

struct spa06_t baro_spa06
 The barometer driver instance, exposed for debugging/telemetry.
 
float baro_spa06_alt
 ISA pressure altitude of the last sample [m].
 
bool baro_spa06_alt_valid
 true once the first valid sample has been processed
 

Detailed Description

Module glue for the Goertek SPA06-003 / SPL06-001 barometer.

Publishes pressure and temperature as ABI messages (BARO_SPA_SENDER_ID); see baro_spa06.c for details. Configure the bus with SPA06_USE_SPI, SPA06_DEV and SPA06_SLAVE_ADDR / SPA06_SLAVE_IDX.

Definition in file baro_spa06.h.

Function Documentation

◆ baro_spa06_event()

void baro_spa06_event ( void  )

Process finished bus transactions and publish new measurements (module event hook)

Process finished bus transactions and publish new measurements (module event hook)

When the driver flags a valid sample: sends ABI BARO_ABS [Pa] and TEMPERATURE [deg Celcius], updates the baro_* globals (including the ISA pressure altitude) and clears data_available for the next sample.

Definition at line 127 of file baro_spa06.c.

References baro_spa06, baro_spa06_alt, baro_spa06_alt_valid, baro_spa06_press, baro_spa06_temp, BARO_SPA_SENDER_ID, spa06_t::data_available, DefaultChannel, DefaultDevice, foo, get_sys_time_usec(), p, pprz_isa_altitude_of_pressure(), spa06_t::pressure, spa06_t::raw_pressure, spa06_t::raw_temperature, spa06_event(), spa06_t::temperature, and up.

+ Here is the call graph for this function:

◆ baro_spa06_init()

void baro_spa06_init ( void  )

Bind the driver to the configured bus and register telemetry (module init hook)

Bind the driver to the configured bus and register telemetry (module init hook)

Bus selection is compile time: SPA06_USE_SPI picks SPI (SPA06_DEV + SPA06_SLAVE_IDX) or I2C (SPA06_DEV + SPA06_SLAVE_ADDR). The sensor itself is detected and configured asynchronously by the periodic/event pair.

Definition at line 97 of file baro_spa06.c.

References baro_spa06, spa06_t::bus, DefaultPeriodic, foo, register_periodic_telemetry(), send_baro_spa_data(), SPA06_I2C, spa06_init(), SPA06_SLAVE_ADDR, SPA06_SLAVE_IDX, and SPA06_SPI.

+ Here is the call graph for this function:

◆ baro_spa06_periodic()

void baro_spa06_periodic ( void  )

Drive the sensor state machine (module periodic hook)

Drive the sensor state machine (module periodic hook)

Definition at line 115 of file baro_spa06.c.

References baro_spa06, and spa06_periodic().

+ Here is the call graph for this function:

Variable Documentation

◆ baro_spa06

struct spa06_t baro_spa06
extern

The barometer driver instance, exposed for debugging/telemetry.

The barometer driver instance, exposed for debugging/telemetry.

Definition at line 71 of file baro_spa06.c.

Referenced by baro_spa06_event(), baro_spa06_init(), baro_spa06_periodic(), and send_baro_spa_data().

◆ baro_spa06_alt

float baro_spa06_alt
extern

ISA pressure altitude of the last sample [m].

Definition at line 65 of file baro_spa06.c.

Referenced by baro_spa06_event().

◆ baro_spa06_alt_valid

bool baro_spa06_alt_valid
extern

true once the first valid sample has been processed

Definition at line 66 of file baro_spa06.c.

Referenced by baro_spa06_event().