This class provides low-level access to internal Flash memory.
Definition at line 89 of file Flash.h.
#include <Flash.h>
◆ FlashClass()
FlashClass::FlashClass |
( |
| ) |
|
|
inline |
Constructor
Definition at line 94 of file Flash.h.
◆ begin()
void FlashClass::begin |
( |
| ) |
|
|
inline |
Initialize Flash
Definition at line 97 of file Flash.h.
◆ end()
Deinitialize Flash
Definition at line 99 of file Flash.h.
◆ erase()
void FlashClass::erase |
( |
uint32_t * |
address, |
|
|
size_t |
size |
|
) |
| |
Erase a page of given size. Size must be page_size aligned! Take care about RADIO, WDT and Interrupt timing!
- Parameters
-
[in] | *address | Pointer to page |
[in] | size | number of page aligned bytes to erase |
◆ erase_all()
void FlashClass::erase_all |
( |
| ) |
|
Erase the complete MCU. This can brick your device!
◆ page_address()
uint32_t* FlashClass::page_address |
( |
size_t |
page | ) |
|
Get a address of a page
- Parameters
-
[in] | page | Page number, starting at 0 |
- Returns
- address of given page
◆ page_count()
uint32_t FlashClass::page_count |
( |
| ) |
const |
Number of managed flash pages
- Returns
- Number of pages
◆ page_size()
uint32_t FlashClass::page_size |
( |
| ) |
const |
Page size in bytes
- Returns
- Number of bytes
◆ page_size_bits()
uint8_t FlashClass::page_size_bits |
( |
| ) |
const |
Page address width in bits. Page size is 2^x
- Returns
- Number of bits
◆ specified_erase_cycles()
uint32_t FlashClass::specified_erase_cycles |
( |
| ) |
const |
Number of page erase cycles
- Returns
- Number of page erase cycles
◆ top_app_page_address()
uint32_t* FlashClass::top_app_page_address |
( |
| ) |
|
Get top of available flash for application data
- Returns
- Last available address + 1
◆ write()
void FlashClass::write |
( |
uint32_t * |
address, |
|
|
uint32_t |
value |
|
) |
| |
write a aligned 32 bit word to flash.
- Parameters
-
[in] | *address | 32 bit aligned pointer to destination word |
[in] | value | Data word to write |
◆ write_block()
void FlashClass::write_block |
( |
uint32_t * |
dst_address, |
|
|
uint32_t * |
src_address, |
|
|
uint16_t |
word_count |
|
) |
| |
write a aligned block to flash.
- Parameters
-
[in] | *dst_address | 32 bit aligned pointer to destination |
[in] | *src_address | 32 bit aligned pointer to source |
[in] | word_count | Number of words to write |
The documentation for this class was generated from the following file: