Commit 4f196e71 authored by deroo's avatar deroo
Browse files

Update README.md

parent f7422e6c
......@@ -8,17 +8,27 @@ The Flash on the nRF52840 has 256 pages of 1024 words, each word is 4 bytes.
Each page is individually erasable; each word is individually writable.
This library defines 2 functions:
int flashErasePage(byte page);
void flashMode(_flashModeEnum mode);
where mode is one of
FLASH_READONLY
FLASH_WRITE
FLASH_ERASE
it also declares 3 constants
flashBytesPerPage
flashBytesPerWord
flashNumberOfPages
with the values given above, or derived from it.
This code is most useful for implementing non-volatile arrays,
......@@ -28,6 +38,7 @@ Arrays of datatypes smaller than a flash word (eg. char, byte, short)
are awkward to implement, but doable.
Write data to a flash array with this motif:
flashMode(FLASH_WRITE);
arrayInFlash[index]=value;
flashMode(FLASH_READONLY);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment