51 #ifdef BARO_ETS_SYNC_SEND
54 #include "pprzlink/messages.h"
56 #endif //BARO_ETS_SYNC_SEND
58 #define BARO_ETS_ADDR 0xE8
59 #define BARO_ETS_REG 0x07
60 #define BARO_ETS_OFFSET_MAX 30000
61 #define BARO_ETS_OFFSET_MIN 10
62 #define BARO_ETS_OFFSET_NBSAMPLES_INIT 20
63 #define BARO_ETS_OFFSET_NBSAMPLES_AVRG 40
64 #define BARO_ETS_R 0.5
65 #define BARO_ETS_SIGMA2 0.1
74 #ifndef BARO_ETS_SCALE
75 #define BARO_ETS_SCALE 37.5
79 #ifndef BARO_ETS_ALT_SCALE
80 #define BARO_ETS_ALT_SCALE 0.32
84 #ifndef BARO_ETS_PRESSURE_OFFSET
85 #define BARO_ETS_PRESSURE_OFFSET 101325.0
88 #ifndef BARO_ETS_I2C_DEV
89 #define BARO_ETS_I2C_DEV i2c0
97 #ifndef BARO_ETS_START_DELAY
98 #define BARO_ETS_START_DELAY 0.2
123 baro_ets_altitude = 0.0;
125 baro_ets_offset_tmp = 0;
126 baro_ets_valid =
false;
127 baro_ets_offset_init =
false;
128 baro_ets_enabled =
true;
135 baro_ets_delay_done =
false;
191 #ifdef BARO_ETS_SYNC_SEND
#define BARO_ETS_START_DELAY
delay in seconds until sensor is read after startup
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
struct i2c_transaction baro_ets_i2c_trans
#define BARO_ETS_SCALE
scale factor to convert raw ADC measurement to pressure in Pascal.
Main include for ABI (AirBorneInterface).
#define BARO_ETS_PRESSURE_OFFSET
Pressure offset in Pascal when converting raw adc to real pressure (.
uint32_t baro_ets_delay_time
transaction set to done by user level
Architecture independent timing functions.
Driver for the EagleTree Systems Altitude Sensor.
bool baro_ets_offset_init
I2C transaction structure.
enum I2CTransactionStatus status
Transaction status.
#define BARO_ETS_ALT_SCALE
scale factor to convert raw ADC measurement to altitude change in meters
#define BARO_ETS_OFFSET_MAX
int32_t pressure
pressure in Pascal
API to get/set the generic vehicle states.
#define BARO_ETS_OFFSET_MIN
bool i2c_receive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint16_t len)
Submit a read only transaction.
void baro_ets_read_periodic(void)
#define BARO_ETS_OFFSET_NBSAMPLES_INIT
Common code for AP and FBW telemetry.
#define BARO_ETS_OFFSET_NBSAMPLES_AVRG
#define SysTimeTimerStart(_t)
Fixedwing Navigation library.
void baro_ets_read_event(void)
uint32_t baro_ets_offset_tmp
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
#define BARO_ETS_SENDER_ID