diff options
Diffstat (limited to 'fw/fe310/eos/spi.h')
-rw-r--r-- | fw/fe310/eos/spi.h | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/fw/fe310/eos/spi.h b/fw/fe310/eos/spi.h index ba04cc0..1463c66 100644 --- a/fw/fe310/eos/spi.h +++ b/fw/fe310/eos/spi.h @@ -1,30 +1,19 @@ #include <stdint.h> #include "event.h" -#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_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_select(unsigned char dev); -int eos_spi_deselect(void); +#define EOS_SPI_EVT_SDC 1 +#define EOS_SPI_EVT_CAM 2 -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); +#define EOS_SPI_MAX_EVT 2 -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_init(void); +void eos_spi_start(uint8_t div, uint8_t csid, uint8_t cspin, unsigned char evt); +void eos_spi_stop(void); +void eos_spi_set_handler(unsigned char evt, eos_evt_handler_t handler); void _eos_spi_xchg_init(unsigned char *buffer, uint16_t len, uint8_t flags); void eos_spi_xchg(unsigned char *buffer, uint16_t len, uint8_t flags); |