HomeAut
adc.h
1 /*******************************************************************************
2  * Purpose:
3  ******************************************************************************/
4 
5 #ifndef ADC_H_
6 #define COMMONADC_H_
7 
8 
9 /*------------------------------------------------------------------------------
10  * Includes
11  *----------------------------------------------------------------------------*/
12 #include "include.h"
13 
14 
15 #ifdef CONFIG_MODULE_ADC_ENABLE
16 
17 /*------------------------------------------------------------------------------
18  * Macros & definitions
19  *----------------------------------------------------------------------------*/
20 
21 
22 
23 /*------------------------------------------------------------------------------
24  * Type definitions
25  *----------------------------------------------------------------------------*/
26 
27 
28 /*------------------------------------------------------------------------------
29  * Global variables
30  *----------------------------------------------------------------------------*/
31 extern volatile uint32_t ADC_MeasuredValues[];
32 
33 extern volatile float ADC_ConvertedValue_VSource;
34 extern volatile uint32_t ADC_ConvertedValue_SensorLight;
35 extern volatile uint32_t ADC_ConvertedValue_SensorMicrophone;
36 extern volatile float ADC_ConvertedValue_InternalTemperature;
37 extern volatile float ADC_ConvertedValue_InternalVref;
38 
39 /*------------------------------------------------------------------------------
40  * Local variables
41  *----------------------------------------------------------------------------*/
42 
43 
44 /*------------------------------------------------------------------------------
45  * Local function declarations
46  *----------------------------------------------------------------------------*/
47 
48 
49 /*------------------------------------------------------------------------------
50  * Global function declarations
51  *----------------------------------------------------------------------------*/
52 void ADC_Init( void );
53 void HAL_ADC_MspInit(ADC_HandleTypeDef *hadc);
54 
55 
56 void ADC_Test ( void );
57 void ADC_Run( void );
58 
59 float ADC_ConvertToSourceVoltage (uint32_t readValue);
60 float ADC_ConvertToVoltage (uint32_t readValue);
61 float ADC_ConvertInternalTempSensorValue (uint32_t readValue);
62 void ADC_ConvertAllMeasuredValues( void );
63 
64 
65 void DMA1_Channel1_IRQHandler(void);
66 void ADC1_IRQHandler(void);
67 void ADC1_DMA_IRQHandler(void);
68 
69 
70 #endif // #ifdef CONFIG_MODULE_ADC_ENABLE
71 
72 
73 #endif /* ADC_H_ */