I-7188XA Series User’s Manual ( Ver1.2, Feb/2014, 7MH-019-10 ) ---
118
Header:
#include ”7188xa.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 ”7188xa.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 <7188xa.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);
}
Summary of Contents for I-7188XA
Page 62: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 62 5 6 COM1 RS 232 1 2 232...
Page 90: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 90 1 2...
Page 140: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 140...
Page 146: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 146 Step 8 Make the project...
Page 153: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 153 Step 8 Rebuild the project...
Page 158: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 158...
Page 162: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 162...
Page 164: ...I 7188XA Series User s Manual Ver1 2 Feb 2014 7MH 019 10 164...