summaryrefslogtreecommitdiff
path: root/code/esp32/components/eos/include
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-05-17 04:03:16 +0200
committerUros Majstorovic <majstor@majstor.org>2020-05-17 04:03:16 +0200
commit5d157b4f7ecea4793c9da5c33a890d4ea4afc545 (patch)
tree6309b33a6d8e5f6beb068e59e001e66c9f677d2a /code/esp32/components/eos/include
parent1cafcbd398fa0e5a4afb1ade33ecf21694cde235 (diff)
power management implemented; net protocol change
Diffstat (limited to 'code/esp32/components/eos/include')
-rw-r--r--code/esp32/components/eos/include/at_cmd.h (renamed from code/esp32/components/eos/include/at_urc.h)4
-rw-r--r--code/esp32/components/eos/include/cell.h17
-rw-r--r--code/esp32/components/eos/include/eos.h9
-rw-r--r--code/esp32/components/eos/include/net.h13
-rw-r--r--code/esp32/components/eos/include/power.h13
5 files changed, 39 insertions, 17 deletions
diff --git a/code/esp32/components/eos/include/at_urc.h b/code/esp32/components/eos/include/at_cmd.h
index 9a4c641..ca46e23 100644
--- a/code/esp32/components/eos/include/at_urc.h
+++ b/code/esp32/components/eos/include/at_cmd.h
@@ -12,6 +12,8 @@
typedef int (*at_urc_cb_t) (char *, regmatch_t[]);
+void at_init(void);
int at_urc_process(char *urc);
int at_urc_insert(char *pattern, at_urc_cb_t cb, int flags);
-int at_urc_delete(char *pattern); \ No newline at end of file
+int at_urc_delete(char *pattern);
+int at_expect(char *str_ok, char *str_err, uint32_t timeout); \ No newline at end of file
diff --git a/code/esp32/components/eos/include/cell.h b/code/esp32/components/eos/include/cell.h
index 3a9e955..17847ce 100644
--- a/code/esp32/components/eos/include/cell.h
+++ b/code/esp32/components/eos/include/cell.h
@@ -1,13 +1,14 @@
#include <sys/types.h>
-#define EOS_CELL_MTYPE_DATA 0
-#define EOS_CELL_MTYPE_AUDIO 1
+#define EOS_CELL_MTYPE_READY 0
+#define EOS_CELL_MTYPE_DATA 1
+#define EOS_CELL_MTYPE_AUDIO 2
-#define EOS_CELL_MTYPE_DATA_START 2
-#define EOS_CELL_MTYPE_DATA_STOP 3
+#define EOS_CELL_MTYPE_DATA_START 4
+#define EOS_CELL_MTYPE_DATA_STOP 5
-#define EOS_CELL_MTYPE_AUDIO_START 4
-#define EOS_CELL_MTYPE_AUDIO_STOP 5
+#define EOS_CELL_MTYPE_AUDIO_START 6
+#define EOS_CELL_MTYPE_AUDIO_STOP 7
#define EOS_CELL_UART_MODE_NONE 0
#define EOS_CELL_UART_MODE_ATCMD 1
@@ -31,11 +32,11 @@ int eos_modem_resp(char *ok_str, char *err_str, uint32_t timeout);
uint8_t eos_modem_get_mode(void);
int eos_modem_set_mode(uint8_t mode);
-int eos_modem_take(void);
+int eos_modem_take(uint32_t timeout);
void eos_modem_give(void);
void eos_modem_sleep(void);
-void eos_modem_wake(void);
+void eos_modem_wake(uint8_t source);
void eos_ppp_set_apn(char *apn);
void eos_ppp_set_auth(char *user, char *pass);
diff --git a/code/esp32/components/eos/include/eos.h b/code/esp32/components/eos/include/eos.h
index 87ac9f3..0e660fb 100644
--- a/code/esp32/components/eos/include/eos.h
+++ b/code/esp32/components/eos/include/eos.h
@@ -1,22 +1,23 @@
#define EOS_OK 0
#define EOS_ERR -1
#define EOS_ERR_TIMEOUT -2
+#define EOS_ERR_BUSY -3
#define EOS_ERR_FULL -10
#define EOS_ERR_EMPTY -11
#define EOS_ERR_NOTFOUND -12
-#define EOS_ERR_BUSY -13
#define EOS_TASK_PRIORITY_UART 1
-#define EOS_TASK_PRIORITY_UART_RI 1
+#define EOS_TASK_PRIORITY_MODEM 1
#define EOS_TASK_PRIORITY_I2S 1
#define EOS_TASK_PRIORITY_NET_XCHG 1
#define EOS_TASK_PRIORITY_UDP_RCVR 1
+#define EOS_TASK_PRIORITY_PWR 1
#define EOS_TASK_SSIZE_UART 4096
-#define EOS_TASK_SSIZE_UART_RI 4096
+#define EOS_TASK_SSIZE_MODEM 4096
#define EOS_TASK_SSIZE_I2S 4096
#define EOS_TASK_SSIZE_NET_XCHG 8192
#define EOS_TASK_SSIZE_UDP_RCVR 4096
-
+#define EOS_TASK_SSIZE_PWR 4096
diff --git a/code/esp32/components/eos/include/net.h b/code/esp32/components/eos/include/net.h
index df1bd0d..818776e 100644
--- a/code/esp32/components/eos/include/net.h
+++ b/code/esp32/components/eos/include/net.h
@@ -1,7 +1,10 @@
#include <stdint.h>
+/* common */
+#define EOS_NET_SIZE_BUF 1500
+
#define EOS_NET_MTYPE_SOCK 1
-#define EOS_NET_MTYPE_AUDIO 2
+#define EOS_NET_MTYPE_POWER 4
#define EOS_NET_MTYPE_WIFI 5
#define EOS_NET_MTYPE_CELL 6
@@ -10,9 +13,9 @@
#define EOS_NET_MAX_MTYPE 8
-#define EOS_NET_MTYPE_FLAG_ONEW 0x10
+#define EOS_NET_MTYPE_FLAG_ONEW 0x80
-#define EOS_NET_SIZE_BUF 1500
+/* esp32 specific */
#define EOS_NET_SIZE_BUFQ 4
#define EOS_NET_SIZE_SNDQ 4
@@ -25,4 +28,6 @@ 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); \ No newline at end of file
+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);
diff --git a/code/esp32/components/eos/include/power.h b/code/esp32/components/eos/include/power.h
new file mode 100644
index 0000000..3f44507
--- /dev/null
+++ b/code/esp32/components/eos/include/power.h
@@ -0,0 +1,13 @@
+#include <stdint.h>
+
+#define EOS_PWR_MTYPE_BUTTON 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
+
+void eos_power_init(void);
+void eos_power_sleep(void);
+void eos_power_wake(uint8_t source);
+void eos_power_1v8rdy(void); \ No newline at end of file