From 4971ba4a97b304ae814b253707a789653f17b3c0 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 10 Aug 2022 19:14:08 +0200 Subject: fixed eve_select --- fw/fe310/eos/eve/eve_platform.c | 8 ++++++-- fw/fe310/eos/eve/eve_platform.h | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'fw/fe310/eos/eve') diff --git a/fw/fe310/eos/eve/eve_platform.c b/fw/fe310/eos/eve/eve_platform.c index f0fc399..a57281c 100644 --- a/fw/fe310/eos/eve/eve_platform.c +++ b/fw/fe310/eos/eve/eve_platform.c @@ -33,10 +33,14 @@ void eve_sys_timer_clear(void) { eos_timer_clear(EOS_TIMER_ETYPE_UI); } -void eve_spi_start(void) { +void eve_select(void) { eos_spi_select(EOS_SPI_DEV_EVE); } -void eve_spi_stop(void) { +void eve_deselect(void) { eos_spi_deselect(); } + +int eve_selected(void) { + return (eos_spi_dev() == EOS_SPI_DEV_EVE); +} diff --git a/fw/fe310/eos/eve/eve_platform.h b/fw/fe310/eos/eve/eve_platform.h index 29240d5..cae7222 100644 --- a/fw/fe310/eos/eve/eve_platform.h +++ b/fw/fe310/eos/eve/eve_platform.h @@ -18,8 +18,9 @@ void eve_free(void *); //#define eve_malloc malloc //#define eve_free free -void eve_spi_start(void); -void eve_spi_stop(void); +void eve_select(void); +void eve_deselect(void); +int eve_selected(void); #define eve_spi_cs_set eos_spi_cs_set #define eve_spi_cs_clear eos_spi_cs_clear -- cgit v1.2.3