summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/eos/eve')
-rw-r--r--fw/fe310/eos/eve/eve_platform.c8
-rw-r--r--fw/fe310/eos/eve/eve_platform.h5
2 files changed, 9 insertions, 4 deletions
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