4.5 Functions for Erasing and Writing EEDATA Memory
These functions support the erasing and writing of EEDATA memory for devices that have this type of memory.
Example of Use
Example 1: dsPIC30F DSCs
#include "libpic30.h"
#include "p30fxxxx.h"
char __attribute__((space(eedata), aligned(_EE_ROW))) dat[_EE_ROW];
int main() {
char i,source[_EE_ROW];
_prog_addressT p;
for (i = 0; i < _EE_ROW; )
source[i] = i++; /* initialize some data */
_init_prog_address(p, dat); /* get address in program space */
_erase_eedata(p, _EE_ROW); /* erase a row */
_wait_eedata(); /* wait for operation to complete */
_write_eedata_row(p, source); /* write a row */
}