-//GoodFET SPI Application
-//Handles basic I/O
+/*! \file spi.c
+ \author Travis Goodspeed
+ \brief SPI Master
+*/
//Higher level left to client application.
//This could be more accurate.
//Does it ever need to be?
#define SPISPEED 0
-#define SPIDELAY(x) delay(x)
+#define SPIDELAY(x)
+//delay(x)
//! Set up the pins for SPI mode.
spitrans8(buf[i]);
SETSS; //Raise !SS to end transaction.
- while(spiflash_status()&0x01)
- ;
+ //while(spiflash_status()&0x01);
return;
}
unsigned char verb,
unsigned char len){
register char blocks=(len>3?cmddata[3]:1);
- unsigned char i,j;
+ unsigned char i;
P5OUT&=~SS; //Drop !SS to begin transaction.
spitrans8(0x03);//Flash Read Command
unsigned char len){
unsigned char i;
-
//Raise !SS to end transaction, just in case we forgot.
- P5OUT|=SS;
+ P5OUT|=SS;
+ spisetup();
switch(verb){
//PEEK and POKE might come later.