2020-07-30 17:11:48 +02:00
|
|
|
#ifndef BATMON_H
|
|
|
|
#define BATMON_H
|
|
|
|
#include <avr/io.h>
|
|
|
|
|
|
|
|
#define ADC_CHANNEL 0
|
|
|
|
#define PORT_ADCC(t) t##D
|
|
|
|
#define PIN_ADCC (1 << 1)
|
|
|
|
|
2020-07-30 21:40:57 +02:00
|
|
|
#define BAT_THRES_POWER_ON 60 // TODO: Minimum ADC value to allow turning the device on
|
|
|
|
#define BAT_THRES_POWER_OFF 50 // TODO: ADC value to (hard) power off the device.
|
|
|
|
|
2020-07-30 17:11:48 +02:00
|
|
|
void batmon_init();
|
|
|
|
uint8_t batmon_get_voltage();
|
2020-07-30 21:40:57 +02:00
|
|
|
uint8_t batmon_proc();
|
2020-07-30 17:11:48 +02:00
|
|
|
|
|
|
|
#endif // BATMON_H
|