2 \author Travis Goodspeed
3 \brief Definitions for the SPI application.
13 #define SETSS P5OUT|=SS
14 #define CLRSS P5OUT&=~SS
16 #define SETMOSI P5OUT|=MOSI
17 #define CLRMOSI P5OUT&=~MOSI
18 #define SETCLK P5OUT|=SCK
19 #define CLRCLK P5OUT&=~SCK
20 #define READMISO (P5IN&MISO?1:0)
22 //! Set up the pins for SPI mode.
25 //! Read and write an SPI byte.
26 unsigned char spitrans8(unsigned char byte);
28 //! Read a block to a buffer.
29 void spiflash_peekblock(unsigned long adr,
34 //! Write many blocks to the SPI Flash.
35 void spiflash_pokeblocks(unsigned long adr,
40 //! Enable SPI writing
41 void spiflash_wrten();
43 //! Read and write an SPI byte.
44 unsigned char spitrans8(unsigned char byte);
45 //! Grab the SPI flash status byte.
46 unsigned char spiflash_status();
48 void spiflash_erasesector(unsigned long adr);