C Language Development Kit/Snippets/Flash/store.h

From OptiWiki

Jump to: navigation, search
/****************************************************************************/
#if PHL|PHL1000|PHL2700
/****************************************************************************/
#define FLASH_BLOCK_NUMBER      1               // Do NOT change this value!!!
#define FLASH_ADDRESS           0x204001UL;     // Do NOT change this value!!!
extern void erase_sector(int no);
#define eraseblock(no) erase_sector((unsigned int)no)
extern void write_flash(unsigned char *address, unsigned char data);
void programbuffer(unsigned char *b, unsigned char *a, int len) { int i; for(i=0;i<len;++i) write_flash(a+i, *(b+i)); }
/****************************************************************************/
#elif OPH
/****************************************************************************/
#define FLASH_BLOCK_NUMBER      30              // Do NOT change this value!!!
#define FLASH_ADDRESS           0x1C1E0000UL;   // Do NOT change this value!!!
/****************************************************************************/
#elif OPH1004
/****************************************************************************/
#define FLASH_BLOCK_NUMBER      62              // Do NOT change this value!!!
#define FLASH_ADDRESS           0x603E0000UL;   // Do NOT change this value!!!
/****************************************************************************/
#else    // OPL972x
/****************************************************************************/
#define FLASH_BLOCK_NUMBER      7               // Do NOT change this value!!!
#define FLASH_ADDRESS           0xC70000UL;     // Do NOT change this value!!!
#endif
/****************************************************************************/
Views
Personal tools