summaryrefslogtreecommitdiff
path: root/code/esp32/components/eos/include
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-05-24 00:00:38 +0200
committerUros Majstorovic <majstor@majstor.org>2020-05-24 00:00:38 +0200
commit375ac3b0c7e9ed8b2d2d0fc4d0700a23c8865836 (patch)
tree2b2b53c1b1823a606983061f4d6f61e7478cc611 /code/esp32/components/eos/include
parent8cab5fea518d4bf6c680816f8ba8b7b7d9ee7401 (diff)
esp32 deep sleep implemented
Diffstat (limited to 'code/esp32/components/eos/include')
-rw-r--r--code/esp32/components/eos/include/cell.h4
-rw-r--r--code/esp32/components/eos/include/i2c.h1
-rw-r--r--code/esp32/components/eos/include/net.h5
-rw-r--r--code/esp32/components/eos/include/power.h7
4 files changed, 13 insertions, 4 deletions
diff --git a/code/esp32/components/eos/include/cell.h b/code/esp32/components/eos/include/cell.h
index 17847ce..23adecf 100644
--- a/code/esp32/components/eos/include/cell.h
+++ b/code/esp32/components/eos/include/cell.h
@@ -35,8 +35,8 @@ int eos_modem_set_mode(uint8_t mode);
int eos_modem_take(uint32_t timeout);
void eos_modem_give(void);
-void eos_modem_sleep(void);
-void eos_modem_wake(uint8_t source);
+void eos_modem_sleep(uint8_t mode);
+void eos_modem_wake(uint8_t source, uint8_t mode);
void eos_ppp_set_apn(char *apn);
void eos_ppp_set_auth(char *user, char *pass);
diff --git a/code/esp32/components/eos/include/i2c.h b/code/esp32/components/eos/include/i2c.h
index 995a77e..144f5e1 100644
--- a/code/esp32/components/eos/include/i2c.h
+++ b/code/esp32/components/eos/include/i2c.h
@@ -2,6 +2,7 @@
#include <stdint.h>
void eos_i2c_init(void);
+
int eos_i2c_read(uint8_t addr, uint8_t reg, uint8_t *data, size_t len);
uint8_t eos_i2c_read8(uint8_t addr, uint8_t reg);
int eos_i2c_write(uint8_t addr, uint8_t reg, uint8_t *data, size_t len);
diff --git a/code/esp32/components/eos/include/net.h b/code/esp32/components/eos/include/net.h
index 818776e..54bad6d 100644
--- a/code/esp32/components/eos/include/net.h
+++ b/code/esp32/components/eos/include/net.h
@@ -25,9 +25,10 @@
typedef void (*eos_net_fptr_t) (unsigned char, unsigned char *, uint16_t);
void eos_net_init(void);
+
unsigned char *eos_net_alloc(void);
void eos_net_free(unsigned char *buf);
int eos_net_send(unsigned char mtype, unsigned char *buffer, uint16_t len, uint8_t flags);
void eos_net_set_handler(unsigned char mtype, eos_net_fptr_t handler);
-void eos_net_sleep_done(void);
-void eos_net_wake(uint8_t source);
+void eos_net_sleep_done(uint8_t mode);
+void eos_net_wake(uint8_t source, uint8_t mode);
diff --git a/code/esp32/components/eos/include/power.h b/code/esp32/components/eos/include/power.h
index 8a35a04..0a57b19 100644
--- a/code/esp32/components/eos/include/power.h
+++ b/code/esp32/components/eos/include/power.h
@@ -2,12 +2,19 @@
#define EOS_PWR_MTYPE_BUTTON 0
+#define EOS_PWR_WAKE_RST 0
#define EOS_PWR_WAKE_BTN 1
#define EOS_PWR_WAKE_NET 2
#define EOS_PWR_WAKE_MSG 3
#define EOS_PWR_WAKE_UART 4
+#define EOS_PWR_SMODE_LIGHT 1
+#define EOS_PWR_SMODE_DEEP 2
+
void eos_power_init(void);
+
+void eos_power_wait4init(void);
+uint8_t eos_power_wakeup_cause(void);
void eos_power_sleep(void);
void eos_power_wake(uint8_t source);
void eos_power_net_ready(void); \ No newline at end of file