Virtual page management on top of Flash.
Definition at line 38 of file VirtualPage.h.
#include <VirtualPage.h>
◆ VirtualPageClass()
VirtualPageClass::VirtualPageClass |
( |
| ) |
|
|
inline |
◆ allocate() [1/2]
uint32_t* VirtualPageClass::allocate |
( |
uint32_t |
magic | ) |
|
Returns an address to a blank page or (uint32_t *)~0 if no space available. Take care about RADIO, WDT and Interrupt timing! Calculate with 0-100ms until a page is available.
- Parameters
-
[in] | magic | A magic number to identify the page. |
- Returns
- Pointer to a page
◆ allocate() [2/2]
uint32_t* VirtualPageClass::allocate |
( |
uint32_t |
magic, |
|
|
uint32_t |
max_writes |
|
) |
| |
Returns an address to a blank page or (uint32_t *)~0 if no space available. Take care about RADIO, WDT and Interrupt timing! Calculate with 0-100ms until a page is available. This function allows using a page multiple times without erasing on some platforms.
- Parameters
-
[in] | magic | A magic number to identify the page. |
[in] | max_writes | The number of planned write operations in page lifecycle. |
- Returns
- Pointer to a page
◆ begin()
void VirtualPageClass::begin |
( |
| ) |
|
|
inline |
◆ clean_up()
void VirtualPageClass::clean_up |
( |
| ) |
|
Prepare released pages for faster reallocation. Plan with 0-100ms.
◆ end()
void VirtualPageClass::end |
( |
| ) |
|
|
inline |
◆ fail()
void VirtualPageClass::fail |
( |
uint32_t * |
address | ) |
|
Mark a page as a defect page.
◆ format()
void VirtualPageClass::format |
( |
| ) |
|
◆ get()
uint32_t* VirtualPageClass::get |
( |
uint32_t |
magic | ) |
|
Search for a page by given, unique magic number. Returns a pointer to (uint32_t *)~0 if there is no page. Don't write to this address.
- Parameters
-
[in] | magic | A magic number to identify the page. |
- Returns
- Pointer to a page
◆ length()
uint16_t VirtualPageClass::length |
( |
| ) |
const |
Reports usable page size in 32 Bit words
- Returns
- Number of words
◆ page_count()
uint16_t VirtualPageClass::page_count |
( |
| ) |
const |
Reports the maximum number of allocatable pages
- Returns
- Number of pages
◆ release()
void VirtualPageClass::release |
( |
uint32_t * |
address | ) |
|
End releasing a page.
- Parameters
-
[in] | *address | A pointer to the page to release |
◆ release_prepare()
void VirtualPageClass::release_prepare |
( |
uint32_t * |
address | ) |
|
Start releasing a page. You have to allocate a new one and then release the old page.
- Parameters
-
[in] | *address | A pointer to the page to release |
◆ release_started()
bool VirtualPageClass::release_started |
( |
uint32_t * |
address | ) |
|
Returns true if page is in release_prepare state
- Parameters
-
[in] | *address | A pointer to a page |
- Returns
- Release state
◆ size()
uint16_t VirtualPageClass::size |
( |
| ) |
const |
Reports usable page size in bytes
- Returns
- Number of bytes
◆ wear_level()
uint32_t VirtualPageClass::wear_level |
( |
| ) |
|
Calculates the rate of wear in percent*100. Values greater than 10000 indicates exceeding the chip specification. This value is only valid for controllers, never erased completely.
- Returns
- calculated level
The documentation for this class was generated from the following file: