diff options
author | Josh Blum <josh@joshknows.com> | 2012-03-05 19:15:22 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-03-23 14:36:56 -0700 |
commit | 08e2432cdeeabd7010252b4a747a385e1b189614 (patch) | |
tree | 835fffb297188cfa6b20282e356e96df0377e5b1 /firmware/zpu/usrp2p/spi_flash.h | |
parent | ee04c245f142ae6637091076445d955108d4da62 (diff) | |
download | uhd-08e2432cdeeabd7010252b4a747a385e1b189614.tar.gz uhd-08e2432cdeeabd7010252b4a747a385e1b189614.tar.bz2 uhd-08e2432cdeeabd7010252b4a747a385e1b189614.zip |
spi: work on fw support for simple spi core
Diffstat (limited to 'firmware/zpu/usrp2p/spi_flash.h')
-rw-r--r-- | firmware/zpu/usrp2p/spi_flash.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/firmware/zpu/usrp2p/spi_flash.h b/firmware/zpu/usrp2p/spi_flash.h index a10533e08..8a8facdca 100644 --- a/firmware/zpu/usrp2p/spi_flash.h +++ b/firmware/zpu/usrp2p/spi_flash.h @@ -23,10 +23,18 @@ #include <stdint.h> #include <stdbool.h> - #define SPI_FLASH_PAGE_SIZE 256 #define SPI_SS_FLASH 1 +#define SPIF_PUSH_RISE 0 // push tx data on rising edge of SCLK +#define SPIF_PUSH_FALL SPI_CTRL_TXNEG // push tx data on falling edge of SCLK +#define SPIF_LATCH_RISE 0 // latch rx data on rising edge of SCLK +#define SPIF_LATCH_FALL SPI_CTRL_RXNEG // latch rx data on falling edge of SCLK + +void spif_init(void); +void spif_wait(void); + +uint32_t spif_transact(bool readback, int slave, uint32_t data, int length, uint32_t flags); uint32_t spi_flash_rdid(void); /* Read ID */ uint32_t spi_flash_rdsr(void); /* Read Status Register */ |