summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eos.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/eos.c')
-rw-r--r--fw/fe310/eos/eos.c75
1 files changed, 29 insertions, 46 deletions
diff --git a/fw/fe310/eos/eos.c b/fw/fe310/eos/eos.c
index 0260073..03609ae 100644
--- a/fw/fe310/eos/eos.c
+++ b/fw/fe310/eos/eos.c
@@ -1,30 +1,26 @@
#include <stdio.h>
#include "event.h"
-#include "interrupt.h"
-#include "timer.h"
-#include "pwr.h"
-#include "i2s.h"
-#include "i2c.h"
-#include "uart.h"
-#include "spi.h"
-#include "spi_dev.h"
-#include "lcd.h"
-#include "sdcard.h"
-#include "net.h"
-#include "wifi.h"
-#include "cell.h"
-#include "sock.h"
-#include "eve_eos.h"
-
-#include "eve/eve.h"
-#include "i2c/gt911.h"
-#include "i2c/bq25895.h"
-
-#include "board.h"
-#include "eos.h"
+#include "soc/interrupt.h"
+#include "soc/timer.h"
+#include "soc/pwr.h"
+#include "soc/i2s.h"
+#include "soc/i2c.h"
+#include "soc/uart.h"
+#include "soc/spi.h"
+
+#include "dev/spi.h"
+#include "dev/net.h"
+#include "dev/sdcard.h"
+#include "dev/bq25895.h"
+#include "dev/eve.h"
+
+#include "net/pwr.h"
+#include "net/wifi.h"
+#include "net/sock.h"
+#include "net/cell.h"
-extern const uint32_t _eos_touch_matrix[6];
+#include "eos.h"
void eos_init(void) {
uint8_t wakeup_cause = eos_pwr_wakeup_cause();
@@ -47,25 +43,18 @@ void eos_init(void) {
if (rv) printf("SPI INIT ERR:%d\n", rv);
rv = eos_spi_dev_init(wakeup_cause);
if (rv) printf("SPI DEV INIT ERR:%d\n", rv);
- rv = eos_sdc_init(wakeup_cause);
- if (rv) printf("SDC INIT ERR:%d\n", rv);
- rv = eos_net_init(wakeup_cause);
- if (rv) printf("NET INIT ERR:%d\n", rv);
- eos_i2c_start();
rv = eos_bq25895_init(wakeup_cause);
- eos_i2c_stop();
if (rv) printf("BQ25895 INIT ERR:%d\n", rv);
- rv = eos_eve_init(wakeup_cause, EVE_GPIO_DIR, _eos_touch_matrix);
- if (rv) printf("EVE INIT ERR:%d\n", rv);
+ rv = eos_net_init(wakeup_cause);
+ if (rv) printf("NET INIT ERR:%d\n", rv);
- rv = eos_lcd_init(wakeup_cause);
- if (rv == EOS_ERR_ABSENT) eve_lcd_absent();
- if (rv) printf("LCD INIT ERR:%d\n", rv);
+ rv = eos_sdc_init(wakeup_cause);
+ if (rv) printf("SDC INIT ERR:%d\n", rv);
- rv = eos_gt911_init(wakeup_cause);
- if (rv) printf("CTP INIT ERR:%d\n", rv);
+ rv = eos_eve_init(wakeup_cause);
+ if (rv) printf("EVE INIT ERR:%d\n", rv);
eos_run(wakeup_cause);
}
@@ -76,20 +65,14 @@ void eos_run(uint8_t wakeup_cause) {
rv = eos_eve_run(wakeup_cause);
if (rv) printf("EVE RUN ERR:%d\n", rv);
- eos_pwr_netinit();
- eos_wifi_netinit();
- eos_cell_netinit();
- eos_sock_netinit();
+ eos_pwr_net_init();
+ eos_wifi_init();
+ eos_sock_init();
+ eos_cell_init();
rv = eos_net_run(wakeup_cause);
if (rv) printf("NET RUN ERR:%d\n", rv);
}
void eos_run_once(void) {
- eos_i2c_start();
- eos_gt911_cfg_print();
- eos_gt911_set_threshold();
- eos_gt911_cfg_print();
- eos_i2c_stop();
-
eos_eve_calibrate();
}