#ifndef __Power
#define __Power

#include <stdint.h>

typedef enum { On, ManualOff, BatteryLow } PowerState;


extern PowerState powerState;
extern uint16_t vcc;


extern void checkPower();
extern void setPowerState(PowerState newState);

extern void sleepUntilButton(uint8_t pinMask);

// 0 = 16 ms
// 1 = 32 ms
// 2 = 64 ms
// 3 = 128 ms
// 4 = 250 ms
// 5 = 500 ms
// 6 = 1 sec
// 7 = 2 sec
// 8 = 4 sec
// 9 = 8 sec
extern void sleepUntilTimer(uint8_t interval);

#endif