Header: #include
”7188xb.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: 0x8000, 0x9000, 0xA000, 0xB000, 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
”7188xb.h”
Description: seg: 0x8000, 0x9000, 0xA000, 0xB000, 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 “7188xb.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);
}
I-7188XB Series User’s Manual(Ver.1.0, Apr/2007,
7MH-020-10
) ---
116
Summary of Contents for I-7188XB Series
Page 88: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 88...
Page 138: ...I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 138...
Page 144: ...Step 8 Make the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 144...
Page 151: ...Step 8 Rebuild the project I 7188XB Series User s Manual Ver 1 0 Apr 2007 7MH 020 10 151...