13 #define BATTERY_PORT PORTD 14 #define BATTERY_STAT_PIN PIN0_bm 15 #define BATTERY_STAT_PINCTRL PIN0CTRL 16 #define BATTERY_PORT_MASK (BATTERY_STAT_PIN) 18 INLINE
void BatteryInit(
void) {
19 BATTERY_PORT.DIRCLR = BATTERY_PORT_MASK;
20 BATTERY_PORT.BATTERY_STAT_PINCTRL = PORT_OPC_PULLUP_gc;
23 INLINE
bool BatteryIsCharging(
void) {
24 if (!(BATTERY_PORT.IN & BATTERY_STAT_PIN)) {