|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
30 #include "pprzlink/messages.h"
36 #define AIRSPEED_AMSYS_ADDR 0xE8 // original F0
37 #ifndef AIRSPEED_AMSYS_SCALE
38 #define AIRSPEED_AMSYS_SCALE 1
40 #define AIRSPEED_AMSYS_OFFSET_MAX 29491
41 #define AIRSPEED_AMSYS_OFFSET_MIN 3277
42 #define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_INIT 40
43 #define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_AVRG 60
44 #define AIRSPEED_AMSYS_NBSAMPLES_AVRG 10
45 #ifndef AIRSPEED_AMSYS_MAXPRESURE
46 #define AIRSPEED_AMSYS_MAXPRESURE 2068 //003-2068, 001-1034 //Pascal
48 #ifndef AIRSPEED_AMSYS_FILTER
49 #define AIRSPEED_AMSYS_FILTER 0
51 #ifndef AIRSPEED_AMSYS_I2C_DEV
52 #define AIRSPEED_AMSYS_I2C_DEV i2c0
54 #ifdef MEASURE_AMSYS_TEMPERATURE
55 #define TEMPERATURE_AMSYS_OFFSET_MAX 29491
56 #define TEMPERATURE_AMSYS_OFFSET_MIN 3277
57 #define TEMPERATURE_AMSYS_MAX 85
58 #define TEMPERATURE_AMSYS_MIN -25
61 #ifndef USE_AIRSPEED_AMSYS
63 #define USE_AIRSPEED_AMSYS TRUE
113 #ifndef MEASURE_AMSYS_TEMPERATURE
120 #if USE_AIRSPEED_AMSYS
124 #elif !defined USE_NPS
130 #ifndef AIRSPEED_AMSYS_SYNC_SEND
149 #ifdef MEASURE_AMSYS_TEMPERATURE
151 const float temp_off_scale = (float)(TEMPERATURE_AMSYS_MAX - TEMPERATURE_AMSYS_MIN) /
152 (TEMPERATURE_AMSYS_OFFSET_MAX - TEMPERATURE_AMSYS_OFFSET_MIN);
155 TEMPERATURE_AMSYS_MIN;
213 #ifdef AIRSPEED_AMSYS_SYNC_SEND
uint16_t airspeed_amsys_raw
static void stateSetAirspeed_f(float airspeed)
Set airspeed (float).
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
void airspeed_amsys_init(void)
struct i2c_transaction airspeed_amsys_i2c_trans
bool airspeed_amsys_valid
float airspeed_amsys_offset
#define AIRSPEED_AMSYS_ADDR
#define AIRSPEED_AMSYS_MAXPRESURE
#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_INIT
#define AIRSPEED_AMSYS_OFFSET_MIN
#define AIRSPEED_AMSYS_OFFSET_MAX
bool airspeed_amsys_offset_init
#define AIRSPEED_AMSYS_SCALE
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
enum I2CTransactionStatus status
Transaction status.
uint16_t airspeed_amsys_cnt
void airspeed_amsys_read_event(void)
I2C transaction structure.
Common code for AP and FBW telemetry.
PRINT_CONFIG_MSG("USE_INS_NAV_INIT defaulting to TRUE")
double airspeed_amsys_offset_tmp
void airspeed_amsys_read_periodic(void)
#define AIRSPEED_AMSYS_FILTER
@ I2CTransDone
transaction set to done by user level
#define AIRSPEED_AMSYS_OFFSET_NBSAMPLES_AVRG
volatile bool airspeed_amsys_i2c_done
uint16_t tempAS_amsys_raw
#define AIRSPEED_AMSYS_I2C_DEV
bool i2c_receive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint16_t len)
Submit a read only transaction.
float airspeed_temperature
void airspeed_amsys_downlink(void)