29 #include "generated/airframe.h"
33 #ifndef USE_AIRSPEED_ADC
34 #define USE_AIRSPEED_ADC TRUE
38 #if !defined AIRSPEED_ADC_QUADRATIC_SCALE && !defined AIRSPEED_ADC_SCALE
39 #error "You need to define either AIRSPEED_ADC_QUADRATIC_SCALE or AIRSPEED_ADC_SCALE (linear)."
44 #ifndef SITL // Use ADC if not in simulation
46 #ifndef ADC_CHANNEL_AIRSPEED
47 #error "ADC_CHANNEL_AIRSPEED needs to be defined to use airspeed_adc module"
50 #ifndef ADC_CHANNEL_AIRSPEED_NB_SAMPLES
51 #define ADC_CHANNEL_AIRSPEED_NB_SAMPLES DEFAULT_AV_NB_SAMPLE
62 #ifdef AIRSPEED_ADC_QUADRATIC_SCALE
78 #ifdef AIRSPEED_ADC_QUADRATIC_SCALE
84 #elif !defined USE_NPS
Read an airspeed or differential pressure sensor via onboard ADC.
void airspeed_adc_update(void)
Main include for ABI (AirBorneInterface).
void adc_buf_channel(uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample)
Link between ChibiOS ADC drivers and Paparazzi adc_buffers.
arch independent ADC (Analog to Digital Converter) API
void airspeed_adc_init(void)
#define ADC_CHANNEL_AIRSPEED_NB_SAMPLES
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
static struct adc_buf buf_airspeed
struct AirspeedAdc airspeed_adc
float scale
used as quadratic scale if AIRSPEED_ADC_QUADRATIC_SCALE, otherwise linear
API to get/set the generic vehicle states.
static void stateSetAirspeed_f(float airspeed)
Set airspeed (float).