31 #include "generated/flight_plan.h"
39 #define BARO_AMSYS_ADDR 0xE4
40 #define BARO_AMSYS_REG 0x07
41 #ifndef BARO_AMSYS_SCALE
42 #define BARO_AMSYS_SCALE 1
44 #ifndef BARO_AMSYS_MAX_PRESSURE
45 #define BARO_AMSYS_MAX_PRESSURE 103400 // Pascal
47 #define BARO_AMSYS_OFFSET_MAX 29491
48 #define BARO_AMSYS_OFFSET_MIN 3277
49 #define BARO_AMSYS_OFFSET_NBSAMPLES_INIT 40
50 #define BARO_AMSYS_OFFSET_NBSAMPLES_AVRG 60
51 #ifndef BARO_AMSYS_FILTER
52 #define BARO_AMSYS_FILTER 0
54 #define BARO_AMSYS_R 0.5
55 #define BARO_AMSYS_SIGMA2 0.1
57 #ifdef MEASURE_AMSYS_TEMPERATURE
58 #define TEMPERATURE_AMSYS_OFFSET_MAX 29491
59 #define TEMPERATURE_AMSYS_OFFSET_MIN 3277
60 #define TEMPERATURE_AMSYS_MAX 85
61 #define TEMPERATURE_AMSYS_MIN -25
65 #ifndef BARO_AMSYS_I2C_DEV
66 #define BARO_AMSYS_I2C_DEV i2c0
122 #ifndef MEASURE_AMSYS_TEMPERATURE
129 #ifdef BARO_AMSYS_SYNC_SEND
143 #ifdef MEASURE_AMSYS_TEMPERATURE
145 const float temp_off_scale = (float)(TEMPERATURE_AMSYS_MAX - TEMPERATURE_AMSYS_MIN) /
146 (TEMPERATURE_AMSYS_OFFSET_MAX - TEMPERATURE_AMSYS_OFFSET_MIN);
149 TEMPERATURE_AMSYS_MIN;
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
struct i2c_transaction baro_amsys_i2c_trans
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
double baro_amsys_offset_tmp
Main include for ABI (AirBorneInterface).
#define BARO_AMSYS_SENDER_ID
float baro_amsys_abs_altitude
#define BARO_AMSYS_FILTER
#define BARO_AMSYS_SIGMA2
#define BARO_AMSYS_OFFSET_NBSAMPLES_AVRG
transaction set to done by user level
#define BARO_AMSYS_MAX_PRESSURE
#define BARO_AMSYS_I2C_DEV
#define BARO_AMSYS_OFFSET_NBSAMPLES_INIT
void baro_amsys_init(void)
#define BARO_AMSYS_OFFSET_MAX
float baro_amsys_altitude
I2C transaction structure.
enum I2CTransactionStatus status
Transaction status.
bool_t baro_amsys_enabled
float baro_amsys_offset_altitude
#define DefaultChannel
SITL.
API to get/set the generic vehicle states.
Common code for AP and FBW telemetry.
void baro_amsys_read_event(void)
bool_t baro_amsys_offset_init
#define BARO_AMSYS_OFFSET_MIN
void baro_amsys_read_periodic(void)
bool_t i2c_receive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint16_t len)
Submit a read only transaction.
Architecture independent I2C (Inter-Integrated Circuit Bus) API.