summaryrefslogtreecommitdiff
path: root/code/fe310/eos/power.h
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-05-17 04:04:22 +0200
committerUros Majstorovic <majstor@majstor.org>2020-05-17 04:04:22 +0200
commitd4ceadf1afc2b3c8120d65ea1f03203df5714d7a (patch)
treee116cd5b58f409e218d60f4c034bf9411c890c63 /code/fe310/eos/power.h
parent75e57273a7ffded0ddcd3698ba68603c4be8a4cd (diff)
power management implemented; net protocol change
Diffstat (limited to 'code/fe310/eos/power.h')
-rw-r--r--code/fe310/eos/power.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/code/fe310/eos/power.h b/code/fe310/eos/power.h
new file mode 100644
index 0000000..7f579a5
--- /dev/null
+++ b/code/fe310/eos/power.h
@@ -0,0 +1,22 @@
+#include <stdint.h>
+#include "event.h"
+
+#define EOS_PWR_MTYPE_BUTTON 0
+
+#define EOS_PWR_MAX_MTYPE 2
+
+#define EOS_PWR_WAKE_RESET 0
+#define EOS_PWR_WAKE_RTC 1
+#define EOS_PWR_WAKE_BTN 2
+
+#define EOS_PWR_RST_PWRON 0
+#define EOS_PWR_RST_EXT 1
+#define EOS_PWR_RST_WDOG 2
+
+void eos_power_init(void);
+uint8_t eos_power_cause_wake(void);
+uint8_t eos_power_cause_rst(void);
+void eos_power_sleep(void);
+void eos_power_wake_at(uint32_t msec);
+void eos_power_wake_disable(void);
+void eos_power_set_handler(unsigned char mtype, eos_evt_handler_t handler); \ No newline at end of file