summaryrefslogtreecommitdiff
path: root/fw/fe310/phone/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/phone/main.c')
-rw-r--r--fw/fe310/phone/main.c94
1 files changed, 94 insertions, 0 deletions
diff --git a/fw/fe310/phone/main.c b/fw/fe310/phone/main.c
new file mode 100644
index 0000000..125a9d2
--- /dev/null
+++ b/fw/fe310/phone/main.c
@@ -0,0 +1,94 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <prci_driver.h>
+
+#include <eos.h>
+#include <dev/eve.h>
+
+#include <eve/eve.h>
+#include <eve/eve_kbd.h>
+#include <eve/eve_font.h>
+
+#include <eve/screen/window.h>
+#include <eve/screen/page.h>
+#include <eve/screen/form.h>
+
+#include "app/app.h"
+
+#include "wifi.h"
+#include "cell.h"
+#include "phone.h"
+#include "modem.h"
+#include "timer.h"
+#include "test.h"
+
+static const uint32_t touch_matrix[6] = {0xf7ac,0x440,0x3e704,0xfffff718,0x108a3,0xfff76d42};
+
+static int home_page(EVEWindow *window, EVEViewStack *stack) {
+ EVEFormSpec spec[] = {
+ {
+ .widget.type = EVE_WIDGET_TYPE_PAGE,
+ .widget.g.w = APP_SCREEN_W,
+ .widget.tspec.page.title = "WiFi",
+ .widget.tspec.page.constructor = wifi_app,
+ },
+ {
+ .widget.type = EVE_WIDGET_TYPE_PAGE,
+ .widget.g.w = APP_SCREEN_W,
+ .widget.tspec.page.title = "Modem",
+ .widget.tspec.page.constructor = modem_app,
+ },
+ {
+ .widget.type = EVE_WIDGET_TYPE_PAGE,
+ .widget.g.w = APP_SCREEN_W,
+ .widget.tspec.page.title = "Phone",
+ .widget.tspec.page.constructor = phone_app,
+ },
+ {
+ .widget.type = EVE_WIDGET_TYPE_PAGE,
+ .widget.g.w = APP_SCREEN_W,
+ .widget.tspec.page.title = "Timer",
+ .widget.tspec.page.constructor = timer_app,
+ },
+ {
+ .widget.type = EVE_WIDGET_TYPE_PAGE,
+ .widget.g.w = APP_SCREEN_W,
+ .widget.tspec.page.title = "Test",
+ .widget.tspec.page.constructor = test_app,
+ },
+ };
+
+ EVEPage *page = eve_form_create(window, stack, spec, APP_SPEC_SIZE(spec), NULL, NULL);
+ if (page == NULL) return EVE_ERR_NOMEM;
+
+ return EVE_OK;
+}
+
+void mem_print(void);
+
+#include <dev/gt911.h>
+
+int main() {
+ uint8_t wakeup_cause;
+
+ wakeup_cause = eos_init();
+ // eos_run_once();
+ eos_eve_set_tmatrix(touch_matrix);
+
+ printf("FREQ:%lu\n", PRCI_get_cpu_freq());
+ printf("\nREADY.\n");
+ mem_print();
+ eos_gt911_cfg_print();
+
+ wifi_init();
+ cell_init();
+ phone_init();
+ app_init(home_page, 0x20);
+
+ eos_run(wakeup_cause);
+
+ eos_evtq_loop();
+}