35 #include "pprzlink/messages.h"
41 #ifndef ADC_CHANNEL_GENERIC1
42 #ifndef ADC_CHANNEL_GENERIC2
43 #error "at least one ADC_CHANNEL_GENERIC1/2 needs to be defined to use the generic_adc module"
47 #ifndef ADC_CHANNEL_GENERIC_NB_SAMPLES
48 #define ADC_CHANNEL_GENERIC_NB_SAMPLES DEFAULT_AV_NB_SAMPLE
51 #if PERIODIC_TELEMETRY
55 #ifndef ADC_GENERIC_PERIODIC_SEND
56 #define ADC_GENERIC_PERIODIC_SEND TRUE
59 #ifdef ADC_CHANNEL_GENERIC1
60 static struct adc_buf buf_generic1;
63 #ifdef ADC_CHANNEL_GENERIC2
64 static struct adc_buf buf_generic2;
68 #ifdef ADC_CHANNEL_GENERIC1
71 #ifdef ADC_CHANNEL_GENERIC2
82 #ifdef ADC_CHANNEL_GENERIC1
85 #ifdef ADC_CHANNEL_GENERIC2
88 #if PERIODIC_TELEMETRY
96 #if ADC_GENERIC_PERIODIC_SEND
#define ADC_CHANNEL_GENERIC_NB_SAMPLES
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
Periodic telemetry system header (includes downlink utility and generated code).
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.
uint16_t adc_generic_val1
void adc_generic_periodic(void)
arch independent ADC (Analog to Digital Converter) API
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
#define DefaultPeriodic
Set default periodic telemetry.
static const struct usb_device_descriptor dev
static void adc_msg_send(struct transport_tx *trans, struct link_device *dev)
Common code for AP and FBW telemetry.
void adc_generic_init(void)
This module can be used to read one or two values from the ADC channels in a generic way...
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
uint16_t adc_generic_val2