OP-1156 fix path logic to not deviate from correct altitude too much
[librepilot.git] / flight / pios / inc / pios_adc.h
blobbde8d11f13660baae06ff320cb88e204f4254bad
1 /**
2 ******************************************************************************
3 * @addtogroup PIOS PIOS Core hardware abstraction layer
4 * @{
5 * @addtogroup PIOS_ADC ADC Functions
6 * @brief STM32 ADC PIOS interface
7 * @{
9 * @file pios_adc.h
10 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
11 * @brief ADC functions header.
12 * @see The GNU Public License (GPL) Version 3
14 *****************************************************************************/
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.
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.
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #ifndef PIOS_ADC_H
32 #define PIOS_ADC_H
34 // Maximum of 50 oversampled points
35 #define PIOS_ADC_MAX_SAMPLES ((((PIOS_ADC_NUM_CHANNELS + PIOS_ADC_USE_ADC2) >> PIOS_ADC_USE_ADC2) << PIOS_ADC_USE_ADC2) * PIOS_ADC_MAX_OVERSAMPLING * 2 / 2)
37 typedef void (*ADCCallback)(float *data);
39 /* Public Functions */
40 void PIOS_ADC_Config(uint32_t oversampling);
41 int32_t PIOS_ADC_PinGet(uint32_t pin);
42 float PIOS_ADC_PinGetVolt(uint32_t pin);
43 int16_t *PIOS_ADC_GetRawBuffer(void);
44 uint8_t PIOS_ADC_GetOverSampling(void);
45 void PIOS_ADC_SetCallback(ADCCallback new_function);
46 #if defined(PIOS_INCLUDE_FREERTOS)
47 void PIOS_ADC_SetQueue(xQueueHandle data_queue);
48 #endif
49 extern void PIOS_ADC_DMA_Handler(void);
51 #endif /* PIOS_ADC_H */
53 /**
54 * @}
55 * @}