Master Thesis
V1.0
Research and Design of Sensor Node for NMSD Treatment
|
Read battery voltage. More...
#include "stdint.h"
Go to the source code of this file.
Macros | |
#define | ADC_FREQ 13000000 /* ADC sample frequency */ |
Functions | |
void | initADC (void) |
Initialisation of the ADC. More... | |
void | ADC0_IRQHandler (void) |
Interrupt handler for ADC. More... | |
void | ADC_Batt_Read (void) |
Do single ADC conversion (read) More... | |
void | ADC_Batt_print (void) |
Print battery in millivolts using dbprint. More... | |
void | ADC_get_batt (uint8_t *percent) |
Get battery in percentage. More... | |
Variables | |
volatile uint32_t | sample |
volatile uint32_t | millivolts |
void ADC0_IRQHandler | ( | void | ) |
Interrupt handler for ADC.
Conversion from ADC read (0-4096) to millivolts
Definition at line 73 of file adc.c.
References millivolts, and sample.
void ADC_Batt_print | ( | void | ) |
Print battery in millivolts using dbprint.
Definition at line 113 of file adc.c.
References dbprint(), dbprintInt(), and millivolts.
void ADC_Batt_Read | ( | void | ) |
Do single ADC conversion (read)
Definition at line 100 of file adc.c.
Referenced by ADC_get_batt().
void ADC_get_batt | ( | uint8_t * | percent | ) |
Get battery in percentage.
20 - 40 - 60 - 80 - 100 percent
[out] | percent | Percentage of the remaining battery capacity |
Definition at line 132 of file adc.c.
References ADC_Batt_Read(), and millivolts.
Referenced by CheckIMUidle().
void initADC | ( | void | ) |
volatile uint32_t millivolts |
Definition at line 26 of file adc.h.
Referenced by ADC0_IRQHandler(), ADC_Batt_print(), and ADC_get_batt().
volatile uint32_t sample |
Definition at line 25 of file adc.h.
Referenced by ADC0_IRQHandler().