Appiko
codebase
peripheral_modules
aa_aaa_battery_check.h
1
20
#ifndef CODEBASE_PERIPHERAL_MODULES_AA_AAA_BATTERY_CHECK_H
21
#define CODEBASE_PERIPHERAL_MODULES_AA_AAA_BATTERY_CHECK_H
22
33
#include "simple_adc.h"
34
35
#ifdef __cplusplus
36
extern
"C"
{
37
#endif
38
43
inline
uint8_t
aa_aaa_battery_status
()
44
{
45
return
((
simple_adc_get_value
(
SIMPLE_ADC_GAIN1_6
,ANALOG_VDD) >> 4) & 0xFF);
46
}
47
48
49
#ifdef __cplusplus
50
}
51
#endif
52
53
#endif
/* CODEBASE_PERIPHERAL_MODULES_AA_AAA_BATTERY_CHECK_H */
54
aa_aaa_battery_status
uint8_t aa_aaa_battery_status()
Function to get battery status. It'll convert battery ADC value to 8bit.
Definition:
aa_aaa_battery_check.h:43
simple_adc_get_value
uint32_t simple_adc_get_value(simple_adc_gain_t gain, simple_adc_input_t pin)
This function initializes the SAADC peripheral, gets an ADC value and then deinitializes The function...
Definition:
simple_adc.c:25
SIMPLE_ADC_GAIN1_6
Gain factor 1/6.
Definition:
simple_adc.h:70
Generated by
1.8.15