HomeAut
commonAdc.h
1 /*
2  * commonAdc.h
3  *
4  * Author: Vizi Gábor
5  * E-mail: vizi.gabor90@gmail.com
6  * Function: Common ADC: Measure more ADC input
7  * Target: STM32Fx
8  * Version: v1
9  * Last modified: 2016.12.08
10  */
11 
12 #ifndef COMMONADC_H_
13 #define COMMONADC_H_
14 
15 
16 /*------------------------------------------------------------------------------
17  * Includes
18  *----------------------------------------------------------------------------*/
19 #include "include.h"
20 
21 
22 #ifdef CONFIG_MODULE_COMMON_ADC_ENABLE
23 
24 /*------------------------------------------------------------------------------
25  * Macros & definitions
26  *----------------------------------------------------------------------------*/
27 
28 
29 
30 /*------------------------------------------------------------------------------
31  * Type definitions
32  *----------------------------------------------------------------------------*/
33 
34 
35 /*------------------------------------------------------------------------------
36  * Global variables
37  *----------------------------------------------------------------------------*/
38 
39 extern ADC_HandleTypeDef AdcHandle;
40 extern volatile uint32_t ADC_MeasuredValues[];
41 extern volatile float ADC_ConvertedValues[];
42 
43 
44 /*------------------------------------------------------------------------------
45  * Local variables
46  *----------------------------------------------------------------------------*/
47 
48 
49 /*------------------------------------------------------------------------------
50  * Local function declarations
51  *----------------------------------------------------------------------------*/
52 
53 
54 /*------------------------------------------------------------------------------
55  * Global function declarations
56  *----------------------------------------------------------------------------*/
57 
58 void CommonADC_Init(void);
59 void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc);
60 
61 void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* AdcHandle);
62 
63 void ADC_Test(void);
64 
65 float ADC_ConvertToVoltage(uint32_t readValue);
66 void ADC_ConvertAllMeasuredValues(void);
67 
68 
69 #endif // #ifdef CONFIG_MODULE_COMMON_ADC_ENABLE
70 
71 
72 #endif /* COMMONADC_H_ */