summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/dev/pwr.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2025-02-16 20:17:43 +0100
committerUros Majstorovic <majstor@majstor.org>2025-02-16 20:17:43 +0100
commitd979b344e5d10c8ecb075554008b707c490db672 (patch)
tree9f3561e9bc9f42a375788c8680c7eabdeb8ea42a /fw/fe310/eos/dev/pwr.c
parent2e17dd17ee9777084b2f211f08c4231dd5f8b906 (diff)
drivers made independent from microcontroller/osHEADmaster
Diffstat (limited to 'fw/fe310/eos/dev/pwr.c')
-rw-r--r--fw/fe310/eos/dev/pwr.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/fw/fe310/eos/dev/pwr.c b/fw/fe310/eos/dev/pwr.c
new file mode 100644
index 0000000..c6537cb
--- /dev/null
+++ b/fw/fe310/eos/dev/pwr.c
@@ -0,0 +1,48 @@
+#include <stdlib.h>
+#include <stdint.h>
+
+#include "eos.h"
+#include "soc/pwr.h"
+#include "eve/eve.h"
+#include "eve/eve_touch_engine.h"
+
+#include "eve.h"
+#include "lcd.h"
+#include "ctp.h"
+#include "net.h"
+#include "flash.h"
+#include "aon.h"
+
+#include "pwr.h"
+
+#ifdef EOS_DEBUG
+#include <stdio.h>
+#endif
+
+void eos_pwr_sys_sleep(void) {
+ int rv;
+
+ rv = eos_lcd_sleep();
+#ifdef EOS_DEBUG
+ if (rv) printf("PWR SLEEP: LCD SLEEP ERR:%d\n", rv);
+#endif
+
+ rv = eos_ctp_sleep();
+#ifdef EOS_DEBUG
+ if (rv) printf("PWR SLEEP: CTP SLEEP ERR:%d\n", rv);
+#endif
+
+ rv = eos_eve_sleep();
+#ifdef EOS_DEBUG
+ if (rv) printf("PWR SLEEP: EVE SLEEP ERR:%d\n", rv);
+#endif
+
+ rv = eos_net_sleep(1000);
+#ifdef EOS_DEBUG
+ if (rv) printf("PWR SLEEP: NET SLEEP ERR:%d\n", rv);
+#endif
+
+ eos_flash_norm();
+
+ eos_pwr_sleep();
+}