Class FlashClass
Public Functions
Type | Name |
---|---|
bool | eraseSector (uint32_t offset) Erase a single block of flash (usually 4 KiB). |
FlashId | getChipId () Flash chip ID structure. |
uint32_t | getSize () Get flash chip total size. |
bool | readBlock (uint32_t offset, uint8_t * data, size_t length) Read data from the flash. |
bool | writeBlock (uint32_t offset, const uint8_t * data, size_t length) Write data to the flash. |
Public Functions Documentation
function eraseSector
Erase a single block of flash (usually 4 KiB).
Parameters:
offset
offset of the block (in bytes); must be multiple of the flash chip's block size
Returns:
whether erasing was successful
function getChipId
function getSize
Get flash chip total size.
The default implementation uses the least significant byte of the chip ID to determine the size.
function readBlock
Read data from the flash.
Parameters:
offset
starting offset (in bytes)data
pointer to where to store the datalength
length of data to read
Returns:
length of data successfully read (should equal 'length')
function writeBlock
Write data to the flash.
Parameters:
offset
starting offset (in bytes)data
pointer to data to writelength
length of data to write
Returns:
length of data successfully written (should equal 'length')
The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/Flash/Flash.h