summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f13d84c)
Still need native POKE.
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@66
12e2690d-a6be-4b82-a7b7-
67c4a43b65c8
+//! Enable SPI writing
+void spiflash_wrten(){
+ P5OUT&=~SS; //Drop !SS to begin transaction.
+ spitrans8(0x06);//Chip Erase
+ P5OUT|=SS; //Raise !SS to end transaction.
+}
+
//! Handles a monitor command.
void spihandle(unsigned char app,
unsigned char verb,
//! Handles a monitor command.
void spihandle(unsigned char app,
unsigned char verb,
txdata(app,verb,len);
P5OUT|=SS; //Raise !SS to end transaction.
break;
txdata(app,verb,len);
P5OUT|=SS; //Raise !SS to end transaction.
break;
+ case POKE://Poke up bytes from an SPI Flash ROM.
+
+ break;
+ case SPI_ERASE://Erase the SPI Flash ROM.
+ spiflash_wrten();
+ P5OUT&=~SS; //Drop !SS to begin transaction.
+ spitrans8(0xC7);//Chip Erase
+ P5OUT|=SS; //Raise !SS to end transaction.
+ txdata(app,verb,0);
+ break;
case SETUP:
spisetup();
txdata(app,verb,0);
case SETUP:
spisetup();
txdata(app,verb,0);
//SPI commands
#define SPI_JEDEC 0x80
#define SPI_ERASE 0x81
//SPI commands
#define SPI_JEDEC 0x80
#define SPI_ERASE 0x81
//JTAG430 commands
#define JTAG430_HALTCPU 0xA0
//JTAG430 commands
#define JTAG430_HALTCPU 0xA0