31 #ifndef USE_AIRSPEED_PBN
33 #define USE_AIRSPEED_PBN TRUE
45 #define PBN_I2C_DEV i2c0
49 #define PBN_I2C_ADDR 0x28
52 #define OFFSET_NBSAMPLES_AVRG 100
55 #define PBN_START_DELAY 30
58 #define PBN_OFFSET_FILTER 7
61 #ifndef PBN_AIRSPEED_SCALE
62 #define PBN_AIRSPEED_SCALE (1./0.54)
66 #ifndef PBN_ALTITUDE_SCALE
67 #define PBN_ALTITUDE_SCALE 0.32
70 #ifndef PBN_PRESSURE_OFFSET
71 #define PBN_PRESSURE_OFFSET 101325.0
100 if (startup_delay > 0) {
126 if (offset_cnt > 0) {
128 #ifndef PBN_AIRSPEED_OFFSET
134 #ifndef PBN_ALTITUDE_OFFSET
static uint16_t startup_delay
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
#define PBN_START_DELAY
Number of loops before starting to store data.
#define OFFSET_NBSAMPLES_AVRG
Number of values to compute an offset at startup.
#define PBN_OFFSET_FILTER
Weight for offset IIR filter.
Main include for ABI (AirBorneInterface).
bool_t i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
#define PBN_I2C_DEV
Default I2C device on tiny is i2c0.
#define PBN_ALTITUDE_SCALE
Linear scale factor for altitude.
transaction set to done by user level
void pbn_read_event(void)
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
#define BARO_PBN_SENDER_ID
#define PBN_PRESSURE_OFFSET
I2C transaction structure.
enum I2CTransactionStatus status
Transaction status.
static uint16_t offset_cnt
API to get/set the generic vehicle states.
static void stateSetAirspeed_f(float airspeed)
Set airspeed (float).
struct i2c_transaction pbn_trans
Pressure Board Navarro (2010)
#define PBN_AIRSPEED_SCALE
Quadratic scale factor for airspeed.
#define PBN_I2C_ADDR
Sensor I2C slave address.