Mercurial > ~darius > hgwebdir.cgi > stm32temp
diff flash.h @ 21:bd8e2cf04034
- Add flash erase, write & read commands (needs more work).
- Split the buffer into argv/argc to make sub commands simpler.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Thu, 15 Nov 2012 23:40:51 +1030 |
parents | 58d76cf522ff |
children | a9cc07caa801 |
line wrap: on
line diff
--- a/flash.h Wed Nov 14 12:47:10 2012 +1030 +++ b/flash.h Thu Nov 15 23:40:51 2012 +1030 @@ -1,16 +1,25 @@ +void flashcmd(char **, int); uint16_t flashreadid(void); uint8_t flashreadstatus(void); void flashwritestatus(uint8_t status); void flashwritectl(int enable); +void flash4kerase(uint32_t addr); +uint8_t flashread(uint32_t addr); +void flashenablewrite(void); +void flashwrite(uint32_t addr, uint8_t data); +#define FL_BUSY (1<<0) +#define FL_WEL (1<<1) #define FL_BP0 (1<<2) #define FL_BP1 (1<<3) #define FL_BP2 (1<<4) #define FL_BP3 (1<<5) +#define FL_AAI (1<<6) #define FL_BPL (1<<7) #define FL_READ 0x03 #define FL_HSREAD 0x0b +#define FL_4KERASE 0x20 #define FL_32KERASE 0x52 #define FL_64KERASE 0xd8 #define FL_CHIPERASE 0x60