00001
00049
00050 #include <ioavr.h>
00051 #include <inavr.h>
00052 #include <stdint.h>
00053
00054
00055 #define SUCCESS 0
00056 #define FAILED -1
00057
00058 #define BUTTON_MASK 0x0E
00059 #define NO_BUTTON 0
00060 #define BUTTON_ONE 1
00061 #define BUTTON_TWO 2
00062 #define BUTTON_THREE 3
00063
00064 #define VTEMP 0x04
00065
00067 #define BANDGAP_WAIT_us 20
00068
00070 #define BANDGAP_ADJ_DELAY BANDGAP_WAIT_us*SYSTEM_CLK_MHz
00071
00072
00073 int8_t ReadButtons(void);
00074 int8_t InitBandgap(void);
00075 uint16_t MeasureTemperature(void);