From 5c4ad4969514b82285ef37922f7acf61600c70de Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 8 Apr 2021 04:03:03 +0200 Subject: reintrodiced spi_dev --- fw/fe310/eos/spi_priv.h | 44 ++++---------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) (limited to 'fw/fe310/eos/spi_priv.h') diff --git a/fw/fe310/eos/spi_priv.h b/fw/fe310/eos/spi_priv.h index a0344ff..72c2dae 100644 --- a/fw/fe310/eos/spi_priv.h +++ b/fw/fe310/eos/spi_priv.h @@ -1,44 +1,8 @@ -#define SPI_MODE0 0x00 -#define SPI_MODE1 0x01 -#define SPI_MODE2 0x02 -#define SPI_MODE3 0x03 - -/* DO NOT TOUCH THEESE */ -#define SPI_SIZE_CHUNK 4 -#define SPI_SIZE_WM 2 - -#define SPI_FLAG_XCHG 0x10 +#include #define SPI_CSID_NONE 1 #define SPI_CSPIN_NONE 0xff -#define SPI_IOF_MASK (((uint32_t)1 << IOF_SPI1_SCK) | ((uint32_t)1 << IOF_SPI1_MOSI) | ((uint32_t)1 << IOF_SPI1_MISO)) | ((uint32_t)1 << IOF_SPI1_SS0) | ((uint32_t)1 << IOF_SPI1_SS2) | ((uint32_t)1 << IOF_SPI1_SS3) - -typedef struct { - uint8_t div; - uint8_t csid; - uint8_t cspin; -} SPIConfig; - -static const SPIConfig spi_cfg[] = { - { // DEV_NET - .div = SPI_DIV_NET, - .csid = SPI_CSID_NET, - .cspin = SPI_CSPIN_NET, - }, - { // DEV_EVE - .div = SPI_DIV_EVE, - .csid = SPI_CSID_EVE, - .cspin = SPI_CSPIN_EVE, - }, - { // DEV_SDC - .div = SPI_DIV_SDC, - .csid = SPI_CSID_SDC, - .cspin = SPI_CSPIN_SDC, - }, - { // DEV_CAM - .div = SPI_DIV_CAM, - .csid = SPI_CSID_CAM, - .cspin = SPI_CSPIN_CAM, - }, -}; \ No newline at end of file +/* DO NOT TOUCH THEESE */ +#define SPI_SIZE_CHUNK 4 +#define SPI_SIZE_WM 2 -- cgit v1.2.3