diff options
author | Uros Majstorovic <majstor@majstor.org> | 2020-08-05 03:39:22 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2020-08-05 03:39:22 +0200 |
commit | cf7c06297d04bade9cd04c056f9ed510e64dd7bd (patch) | |
tree | a3b8cc23574b98e10874b51d33c9fe1bfc012663 /fw/fe310/eos/eos.c | |
parent | 5cd610a07468137066ea4daa5176c3e7045113b0 (diff) |
code -> fw
Diffstat (limited to 'fw/fe310/eos/eos.c')
-rw-r--r-- | fw/fe310/eos/eos.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/fw/fe310/eos/eos.c b/fw/fe310/eos/eos.c new file mode 100644 index 0000000..b02abed --- /dev/null +++ b/fw/fe310/eos/eos.c @@ -0,0 +1,43 @@ +#include <stdio.h> + +#include "event.h" +#include "interrupt.h" +#include "timer.h" +#include "power.h" +#include "i2s.h" +#include "uart.h" +#include "spi.h" +#include "net.h" +#include "wifi.h" +#include "cell.h" +#include "sock.h" +#include "eve/eve.h" + +#include "eos.h" + +static uint32_t eve_touch[6] = {0xfa46,0xfffffcf6,0x422fe,0xffffff38,0x10002,0xf3cb0}; + +void eos_init(void) { + uint8_t wakeup_cause = eos_power_wakeup_cause(); + printf("WAKE:%d\n", wakeup_cause); + + eos_evtq_init(); + eos_intr_init(); + eos_timer_init(); + eos_i2s_init(); + eos_uart_init(); + eos_spi_init(); + eos_net_init(); + eos_power_init(); + eos_wifi_init(); + eos_cell_init(); + eos_sock_init(); + eos_spi_dev_init(); + + eos_net_wake(wakeup_cause); + + eve_set_touch_calibration(eve_touch); + eos_spi_dev_start(EOS_DEV_DISP); + eve_init(wakeup_cause == EOS_PWR_WAKE_RST); + eos_spi_dev_stop(); +} |