36 #include "generated/airframe.h"
39 #if ! (defined SITL || defined HITL)
43 #ifdef ADC_CHANNEL_IR_TOP
48 #ifndef ADC_CHANNEL_IR_NB_SAMPLES
49 #define ADC_CHANNEL_IR_NB_SAMPLES DEFAULT_AV_NB_SAMPLE
73 #if ! (defined SITL || defined HITL)
76 #ifdef ADC_CHANNEL_IR_TOP
83 #if ! (defined ADC_CHANNEL_IR_TOP || defined HITL || defined SITL)
94 #if ! (defined SITL || defined HITL)
97 #ifdef ADC_CHANNEL_IR_TOP
98 ir_adc.
ir3 = (
int32_t)(buf_ir3.sum / buf_ir3.av_nb_sample) - IR_ADC_TOP_NEUTRAL;
#define ADC_CHANNEL_IR_NB_SAMPLES
void infrared_update(void)
struct Infrared_raw ir_adc
void infrared_event(void)
arch independent ADC (Analog to Digital Converter) API
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
void infrared_struct_init(void)
Initialisation of ir structure.
#define UpdateIRValue(_v)
void adc_buf_channel(uint8_t adc_channel, struct adc_buf *s, uint8_t av_nb_sample)
Registers a buffer to be used to store the specified converted channel Usage:
void infrared_adc_init(void)
Initialisation of ir.
static struct adc_buf buf_ir1
void infrared_adc_update(void)
Update ir_roll and ir_pitch from ADCs or from simulator message in HITL and SITL modes.
static struct adc_buf buf_ir2