
Header: #include
”7188xc.h”
Description: Erases a single sector (64K bytes) of the Flash memory.
The value of all data on that sector will revert to 0xFF.
seg: 0xC000, 0xD000 or 0xE000.
Return Value: On success, returns NoError (0).
On error, returns TimeOut (-5).
Example: Please refer to “\Demo\BC_TC\Memory\Flash\ FLASH.C”
for more detailed information.
Note
: Segment 0xF000 is used to store the MiniOS7, if attempting to
erase segment 0xF000, FlashErase() will do nothing.
FlashWrite()
Function: Writes one byte of data to Flash memory.
Syntax:
int FlashWrite(unsigned int seg, unsigned int offset,
char data);
Header: #include
”7188xc.h”
Description: seg: 0xC000, 0xD000 or 0xE000.
offset: 0 to 65535 (0xffff).
data: 0 to 255 (8-bit data).
Return Value: On success, returns NoError(0).
On error, returns TimeOut(-5) or SegmentError(-12).
Example:
#include “7188xc.h”
void main()
{
int data=0xAA55, data2;
char *dataptr;
InitLib();
dataptr=(char *)&data;
FlashWrite(0xd000,0x1234, *+); /*writes
data to the Flash
memory*/
FlashWrite(0xd000,0x1235, *dataptr);
dataptr=(char *)&data2;
/*reads data from the Flash memory*/
*dataptr=FlashRead(0xd000, 0x1234);
*(1)=FlashRead(0xd000, 0x1235);
}
Note
: When writing data to the Flash memory, the data bit only can
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
114
Содержание I-7188XC Series
Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...