2 \author Travis Goodspeed
3 \brief Definitions for the SPI application.
19 #define SETMOSI P5OUT|=MOSI
20 #define CLRMOSI P5OUT&=~MOSI
21 #define SETCLK P5OUT|=SCK
22 #define CLRCLK P5OUT&=~SCK
23 #define READMISO (P5IN&MISO?1:0)
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;