Master Thesis  V1.0
Research and Design of Sensor Node for NMSD Treatment
adc.h
Go to the documentation of this file.
1 /***************************************************************************/
9 /*
10  * adcbatt.h
11  *
12  * Created on: Nov 19, 2019
13  * Author: jonac
14  */
15 
16 #ifndef ADC_ADC_H_
17 #define ADC_ADC_H_
18 
19 #include "stdint.h"
20 
21 /*************************************/
22 
23 #define ADC_FREQ 13000000 /* ADC sample frequency */
24 
25 volatile uint32_t sample; /* Variable to store the sampled battery voltage value */
26 volatile uint32_t millivolts; /* Variable to store the battery voltage */
27 
28 /*************************************/
29 
30 void initADC (void);
31 void ADC0_IRQHandler(void);
32 void ADC_Batt_Read(void);
33 void ADC_Batt_print(void);
34 void ADC_get_batt( uint8_t *percent );
35 
36 #endif /* ADC_ADC_H_ */
initADC
void initADC(void)
Initialisation of the ADC.
Definition: adc.c:32
ADC_Batt_Read
void ADC_Batt_Read(void)
Do single ADC conversion (read)
Definition: adc.c:100
millivolts
volatile uint32_t millivolts
Definition: adc.h:26
sample
volatile uint32_t sample
Definition: adc.h:25
ADC0_IRQHandler
void ADC0_IRQHandler(void)
Interrupt handler for ADC.
Definition: adc.c:73
ADC_Batt_print
void ADC_Batt_print(void)
Print battery in millivolts using dbprint.
Definition: adc.c:113
ADC_get_batt
void ADC_get_batt(uint8_t *percent)
Get battery in percentage.
Definition: adc.c:132