Fixed 2274 support.
[goodfet] / firmware / include / spi.h
index f5c0d8e..02e548a 100644 (file)
@@ -5,14 +5,11 @@
 
 
 //Pins and I/O
-#define SS   BIT0
+//#define SS BIT0
 #define MOSI BIT1
 #define MISO BIT2
 #define SCK  BIT3
 
-#define SETSS P5OUT|=SS
-#define CLRSS P5OUT&=~SS
-
 #define SETMOSI P5OUT|=MOSI
 #define CLRMOSI P5OUT&=~MOSI
 #define SETCLK P5OUT|=SCK
@@ -35,3 +32,14 @@ void spiflash_peekblock(unsigned long adr,
 void spiflash_pokeblocks(unsigned long adr,
                         unsigned char *buf,
                         unsigned int len);
+
+
+//! Enable SPI writing
+void spiflash_wrten();
+
+//! Read and write an SPI byte.
+unsigned char spitrans8(unsigned char byte);
+//! Grab the SPI flash status byte.
+unsigned char spiflash_status();
+//! Erase a sector.
+void spiflash_erasesector(unsigned long adr);