forked from panStamp/arduino_nrg
-
Notifications
You must be signed in to change notification settings - Fork 0
Information memory (EEPROM) API
George edited this page Jan 7, 2019
·
6 revisions
The CC430 family of MCUs comes with an area of the flash that can store data permanently, similar to what EEPROM does in Arduino AVR. The CC430F5137 contains 512Kb of information memory segmented in 4 areas (Info A, Info B, Info C, Info D) of 128kB each. Their address spaces start from 001800h to 0019FFh. The way these addresses are accessed, written or erased is through the STORAGE API that panStamp provides.
An example code is as it follows:
STORAGE nvMem;
uint8_t value;
uint8_t value_read;
// Read from info/eeprom memory. Contents read using this function will be stored in the variable "value_read".
nvMem.read(&value_read, section, position, sizeof(value_read));
// write into info/eeprom memory. Contents written using this function come from the variable "value".
nvMem.write(&value, section, position, sizeof(value));
Section can be of the following (from first to last section):
INFOMEM_SECTION_D
INFOMEM_SECTION_C
INFOMEM_SECTION_B
INFOMEM_SECTION_A
Position can be of the following:
0
to 127
More information about the addresses: panStamp NRG 3 Technical Details