From 66e53b7e54878e2161f5c0dab6f90aebd9a1d97a Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 8 Apr 2021 02:27:15 +0200 Subject: added board.h --- fw/fe310/eos/spi.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'fw/fe310/eos/spi.h') diff --git a/fw/fe310/eos/spi.h b/fw/fe310/eos/spi.h index 7cbff08..ba04cc0 100644 --- a/fw/fe310/eos/spi.h +++ b/fw/fe310/eos/spi.h @@ -1,19 +1,29 @@ #include #include "event.h" -#include "spi_dev.h" -#define EOS_SPI_MAX_DEV EOS_DEV_MAX_DEV +#define EOS_SPI_DEV_NET 0 +#define EOS_SPI_DEV_EVE 1 +#define EOS_SPI_DEV_SDC 2 +#define EOS_SPI_DEV_CAM 3 -#define EOS_SPI_FLAG_TX 0x01 -#define EOS_SPI_FLAG_MORE 0x02 -#define EOS_SPI_FLAG_BSWAP 0x04 +#define EOS_SPI_MAX_DEV 4 + +#define EOS_SPI_FLAG_TX 0x01 +#define EOS_SPI_FLAG_MORE 0x02 +#define EOS_SPI_FLAG_BSWAP 0x04 void eos_spi_init(void); -int eos_spi_start(unsigned char dev, uint32_t div, uint32_t csid, uint8_t pin); -int eos_spi_stop(void); +int eos_spi_select(unsigned char dev); +int eos_spi_deselect(void); + uint8_t eos_spi_dev(void); +uint16_t eos_spi_div(unsigned char dev); +uint16_t eos_spi_csid(unsigned char dev); +uint16_t eos_spi_cspin(unsigned char dev); + void eos_spi_lock(void); void eos_spi_unlock(void); +void eos_spi_set_div(unsigned char dev, uint16_t div); void eos_spi_set_handler(unsigned char dev, eos_evt_handler_t handler); void _eos_spi_xchg_init(unsigned char *buffer, uint16_t len, uint8_t flags); -- cgit v1.2.3