39 #define AD0_VIC_SLOT 2
45 #define AD1_VIC_SLOT 4
56 void adcISR0(
void) __attribute__((naked));
57 void adcISR1(
void) __attribute__((naked));
62 if (adc_channel >= (
NB_ADC * 2))
return;
63 buffers[adc_channel] =
s;
102 #if defined USE_AD1_2
105 #if defined USE_AD1_3
108 #if defined USE_AD1_4
111 #if defined USE_AD1_5
117 #if defined USE_AD0_0
120 #if defined USE_AD0_1
123 #if defined USE_AD0_2
126 #if defined USE_AD0_3
129 #if defined USE_AD0_4
132 #if defined USE_AD0_5
135 #if defined USE_AD1_6
138 #if defined USE_AD1_7
144 static const uint32_t ADC_AD0CR_SEL_HW_SCAN = 0
145 #if defined USE_AD0_0
148 #if defined USE_AD0_1
151 #if defined USE_AD0_2
154 #if defined USE_AD0_3
157 #if defined USE_AD0_4
160 #if defined USE_AD0_5
163 #if defined USE_AD0_6
166 #if defined USE_AD0_7
173 static const uint32_t ADC_AD1CR_SEL_HW_SCAN = 0
174 #if defined USE_AD1_0
177 #if defined USE_AD1_1
180 #if defined USE_AD1_2
183 #if defined USE_AD1_3
186 #if defined USE_AD1_4
189 #if defined USE_AD1_5
192 #if defined USE_AD1_6
195 #if defined USE_AD1_7
213 AD0CR = ADC_AD0CR_SEL_HW_SCAN | 0xFF << 8 | 1 << 16 | 0x01 << 21 ;
228 AD1CR = ADC_AD1CR_SEL_HW_SCAN | 0xFF << 8 | 1 << 16 | 0x01 << 21 ;
254 buf->
values[new_head] = value;
256 buf->
head = new_head;
275 buf->
values[new_head] = value;
277 buf->
head = new_head;
volatile uint16_t adc0_val[NB_ADC]
static const uint32_t ADC_PINSEL1_ONES
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.
#define NB_ADC
8 ADCs for bank 0, others for bank 2
arch independent ADC (Analog to Digital Converter) API
Generic interface for all ADC hardware drivers, independent from microcontroller architecture.
volatile uint16_t adc1_val[NB_ADC]
static const uint32_t ADC_PINSEL0_ONES
uint16_t values[MAX_AV_NB_SAMPLE]
static struct adc_buf * buffers[NB_ADC *2]
First NB_ADC for bank 0, others for bank 2.
void adc_init(void)
Adc init.