2 \author Travis Goodspeed
3 \brief Definitions for the SPI application.
18 #define SETMOSI SPIOUT|=MOSI
19 #define CLRMOSI SPIOUT&=~MOSI
20 #define SETCLK SPIOUT|=SCK
21 #define CLRCLK SPIOUT&=~SCK
22 #define READMISO (SPIIN&MISO?1:0)
24 //FIXME this should be defined by the platform.
25 #define SETTST P4OUT|=TST
26 #define CLRTST P4OUT&=~TST
27 #define SETRST P2OUT|=RST
28 #define CLRRST P2OUT&=~RST
30 //! Set up the pins for SPI mode.
33 //! Read and write an SPI byte.
34 unsigned char spitrans8(unsigned char byte);
36 //! Read a block to a buffer.
37 void spiflash_peekblock(unsigned long adr,
42 //! Write many blocks to the SPI Flash.
43 void spiflash_pokeblocks(unsigned long adr,
48 //! Enable SPI writing
49 void spiflash_wrten();
51 //! Read and write an SPI byte.
52 unsigned char spitrans8(unsigned char byte);
53 //! Grab the SPI flash status byte.
54 unsigned char spiflash_status();
56 void spiflash_erasesector(unsigned long adr);
58 extern app_t const spi_app;