dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_internal_adc_simple.h
Go to the documentation of this file.
1 
15 /*
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful, but
22  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24  * for more details.
25  *
26  * You should have received a copy of the GNU General Public License along
27  * with this program; if not, see <http://www.gnu.org/licenses/>
28  */
29 
30 #ifndef PIOS_INTERNAL_ADC_PRIV_H
31 #define PIOS_INTERNAL_ADC_PRIV_H
32 
33 #include <pios.h>
34 #include <pios_stm32.h>
35 
36 #include <stm32f0xx_adc.h>
37 
38 extern const struct pios_adc_driver pios_internal_adc_driver;
39 
40 typedef struct pios_internal_adc_dev *pios_internal_adc_t;
41 
45 struct adc_pin {
46  GPIO_TypeDef *port;
47  uint32_t pin;
48  uint32_t adc_channel;
49 };
50 
55  ADC_TypeDef* adc_dev;
57  uint8_t adc_pin_count;
58  struct adc_pin adc_pins[];
59 };
60 
61 int32_t PIOS_INTERNAL_ADC_Init(pios_internal_adc_t *internal_adc_id, const struct pios_internal_adc_simple_cfg * cfg);
62 
63 void PIOS_INTERNAL_ADC_DoStep(pios_internal_adc_t internal_adc_id);
64 
65 #endif /* PIOS_INTERNAL_ADC_PRIV_H */
66 
Types that are specific to the STM32 peripherals.
Main PiOS header to include all the compiled in PiOS options.
void PIOS_INTERNAL_ADC_DoStep(pios_internal_adc_t internal_adc_id)
int32_t PIOS_INTERNAL_ADC_Init(pios_internal_adc_t *internal_adc_id, const struct pios_internal_adc_simple_cfg *cfg)
struct pios_internal_adc_dev * pios_internal_adc_t
static struct flyingpicmd_cfg_fa cfg
Definition: main.c:49
const struct pios_adc_driver pios_internal_adc_driver
GPIO_TypeDef * port