2 \author Travis Goodspeed
3 \brief Definitions for the SPI application.
13 #define SETMOSI P5OUT|=MOSI
14 #define CLRMOSI P5OUT&=~MOSI
15 #define SETCLK P5OUT|=SCK
16 #define CLRCLK P5OUT&=~SCK
17 #define READMISO (P5IN&MISO?1:0)
19 #define SETTST P4OUT|=TST
20 #define CLRTST P4OUT&=~TST
21 #define SETRST P2OUT|=RST
22 #define CLRRST P2OUT&=~RST
25 //! Set up the pins for SPI mode.
28 //! Read and write an SPI byte.
29 unsigned char spitrans8(unsigned char byte);
31 //! Read a block to a buffer.
32 void spiflash_peekblock(unsigned long adr,
37 //! Write many blocks to the SPI Flash.
38 void spiflash_pokeblocks(unsigned long adr,
43 //! Enable SPI writing
44 void spiflash_wrten();
46 //! Read and write an SPI byte.
47 unsigned char spitrans8(unsigned char byte);
48 //! Grab the SPI flash status byte.
49 unsigned char spiflash_status();
51 void spiflash_erasesector(unsigned long adr);