From cf7c06297d04bade9cd04c056f9ed510e64dd7bd Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 5 Aug 2020 03:39:22 +0200 Subject: code -> fw --- code/fe310/eos/eve/eve_platform.c | 63 --------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 code/fe310/eos/eve/eve_platform.c (limited to 'code/fe310/eos/eve/eve_platform.c') diff --git a/code/fe310/eos/eve/eve_platform.c b/code/fe310/eos/eve/eve_platform.c deleted file mode 100644 index e64d326..0000000 --- a/code/fe310/eos/eve/eve_platform.c +++ /dev/null @@ -1,63 +0,0 @@ -#include - -#include "platform.h" - -#include "eos.h" -#include "interrupt.h" -#include "event.h" -#include "eve.h" -#include "eve_platform.h" - -#include "irq_def.h" - -static void handle_time(unsigned char type) { - eos_spi_dev_start(EOS_DEV_DISP); - eve_handle_time(); - eos_spi_dev_stop(); -} - -static void handle_evt(unsigned char type, unsigned char *buffer, uint16_t len) { - eos_spi_dev_start(EOS_DEV_DISP); - eve_handle_touch(); - eos_spi_dev_stop(); - - GPIO_REG(GPIO_LOW_IP) = (1 << EVE_PIN_INTR); - GPIO_REG(GPIO_LOW_IE) |= (1 << EVE_PIN_INTR); -} - -static void handle_intr(void) { - GPIO_REG(GPIO_LOW_IE) &= ~(1 << EVE_PIN_INTR); - eos_evtq_push_isr(EOS_EVT_UI | EVE_ETYPE_INTR, NULL, 0); - return; -} - -void eve_time_sleep(uint32_t ms) { - eos_time_sleep(ms); -} - -void eve_timer_set(uint32_t ms) { - eos_timer_set(ms, EOS_TIMER_ETYPE_UI); -} - -void eve_timer_clear(void) { - eos_timer_clear(EOS_TIMER_ETYPE_UI); -} - -uint64_t eve_time_get_tick(void) { - return eos_time_get_tick(); -} - -void eve_platform_init(void) { - eos_evtq_set_handler(EOS_EVT_UI, handle_evt); - eos_timer_set_handler(EOS_TIMER_ETYPE_UI, handle_time); - - GPIO_REG(GPIO_INPUT_EN) |= (1 << EVE_PIN_INTR); - GPIO_REG(GPIO_OUTPUT_EN) &= ~(1 << EVE_PIN_INTR); - GPIO_REG(GPIO_PULLUP_EN) &= ~(1 << EVE_PIN_INTR); - GPIO_REG(GPIO_OUTPUT_XOR) &= ~(1 << EVE_PIN_INTR); - - GPIO_REG(GPIO_LOW_IE) |= (1 << EVE_PIN_INTR); - eos_intr_set(INT_GPIO_BASE + EVE_PIN_INTR, IRQ_PRIORITY_UI, handle_intr); - - eos_spi_dev_set_div(EOS_DEV_DISP, 4); -} -- cgit v1.2.3