Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
adc_arch.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 AggieAir, A Remote Sensing Unmanned Aerial System for Scientific Applications
3  * Utah State University, http://aggieair.usu.edu/
4  *
5  * Michal Podhradsky (michal.podhradsky@aggiemail.usu.edu)
6  * Calvin Coopmans (c.r.coopmans@ieee.org)
7  *
8  * Copyright (C) 2015 Gautier Hattenberger, Alexandre Bustico
9  *
10  * This file is part of paparazzi.
11  *
12  * paparazzi is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 2, or (at your option)
15  * any later version.
16  *
17  * paparazzi is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with paparazzi; see the file COPYING. If not, write to
24  * the Free Software Foundation, 59 Temple Place - Suite 330,
25  * Boston, MA 02111-1307, USA.
26  */
33 #ifndef ADC_ARCH_H
34 #define ADC_ARCH_H
35 
36 #include "hal.h"
37 
38 #include BOARD_CONFIG
39 
40 // NB_ADCx_CHANNELS
42 #ifdef AD1_1_CHANNEL
43  AD1_1,
44 #endif
45 #ifdef AD1_2_CHANNEL
46  AD1_2,
47 #endif
48 #ifdef AD1_3_CHANNEL
49  AD1_3,
50 #endif
51 #ifdef AD1_4_CHANNEL
52  AD1_4,
53 #endif
54 #ifdef AD1_5_CHANNEL
55  AD1_5,
56 #endif
57 #ifdef AD1_6_CHANNEL
58  AD1_6,
59 #endif
60 #ifdef AD1_7_CHANNEL
61  AD1_7,
62 #endif
63 #ifdef AD1_8_CHANNEL
64  AD1_8,
65 #endif
66 #ifdef AD1_9_CHANNEL
67  AD1_9,
68 #endif
69 #ifdef AD1_10_CHANNEL
70  AD1_10,
71 #endif
72 #ifdef AD1_11_CHANNEL
73  AD1_11,
74 #endif
75 #ifdef AD1_12_CHANNEL
76  AD1_12,
77 #endif
78 #ifdef AD1_13_CHANNEL
79  AD1_13,
80 #endif
81 #ifdef AD1_14_CHANNEL
82  AD1_14,
83 #endif
84 #ifdef AD1_15_CHANNEL
85  AD1_15,
86 #endif
87 #ifdef AD1_16_CHANNEL
88  AD1_16,
89 #endif
91 };
92 
93 #define ADC_NUM_CHANNELS (NB_ADC1_CHANNELS)
94 
95 // ADC error flags
96 extern uint8_t adc_error_flag;
97 extern ADCDriver *adcp_err;
98 
99 #if USE_ADC_WATCHDOG
100 
101 /* Watchdog callback type definition
102  */
103 typedef void (*adc_watchdog_callback)(void);
104 
105 /* Watchdog register function
106  *
107  * @param adc adc bank to monitor
108  * @param channel adc channel to monitor
109  * @param vmin low threshhold for callback trigger
110  * @param cb callback function call within ISR locked zone
111  */
112 extern void register_adc_watchdog(ADCDriver *adc, adc_channels_num_t channel, adcsample_t vmin,
113  adc_watchdog_callback cb);
114 
115 #endif
116 
117 
118 
119 #endif /* ADC_ARCH_H */
adc1_channels
Definition: adc_arch.h:41
@ NB_ADC1_CHANNELS
Definition: adc_arch.h:90
ADCDriver * adcp_err
Definition: adc_arch.c:133
uint8_t adc_error_flag
Definition: adc_arch.c:132
float vmin
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98