Interface for flash storage.
More...
#include <flash.h>
|
virtual | ~Flash ()=default |
|
virtual void | erase (size_t sector, size_t numOfSectors=1)=0 |
| Erase sector(s). More...
|
|
virtual size_t | sector (uint32_t address) const =0 |
| Return in which sector an address is located. More...
|
|
virtual uint32_t | address (size_t sector) const =0 |
| Return on which address a sector starts. More...
|
|
virtual size_t | sectorSize (size_t sector) const =0 |
| Return the size of a sector in bytes. More...
|
|
virtual size_t | numberOfSectors () const =0 |
| Return the number/amount of sectors of a flash memory. More...
|
|
virtual | ~Storage ()=default |
|
virtual void | write (uint32_t address, const uint8_t data[], size_t dataSize)=0 |
| Writes data into the storage. More...
|
|
virtual void | read (uint32_t address, uint8_t buffer[], size_t bufferSize)=0 |
| Reads data from the storage into a given read buffer. More...
|
|
virtual bool | isBusy () const =0 |
| Returns if the storage is busy reading, writing or e.g. erasing. More...
|
|
Interface for flash storage.
Definition at line 23 of file flash.h.
◆ ~Flash()
virtual semf::app::Flash::~Flash |
( |
| ) |
|
|
virtualdefault |
◆ address()
virtual uint32_t semf::app::Flash::address |
( |
size_t |
sector | ) |
const |
|
pure virtual |
Return on which address a sector starts.
- Parameters
-
sector | Sector index in a flash memory. |
- Returns
- The address, where a sector starts.
◆ erase()
virtual void semf::app::Flash::erase |
( |
size_t |
sector, |
|
|
size_t |
numOfSectors = 1 |
|
) |
| |
|
pure virtual |
Erase sector(s).
- Parameters
-
sector | The numerical order of the targeted sector. |
numOfSectors | Amount of sectors to be erased. |
Implemented in semf::Stm32Flash.
◆ numberOfSectors()
virtual size_t semf::app::Flash::numberOfSectors |
( |
| ) |
const |
|
pure virtual |
Return the number/amount of sectors of a flash memory.
- Returns
- Number of sectors.
◆ sector()
virtual size_t semf::app::Flash::sector |
( |
uint32_t |
address | ) |
const |
|
pure virtual |
Return in which sector an address is located.
- Attention
- Return 0, if the address is out of available address range.
- Parameters
-
address | Address in a Flash memory. |
- Returns
- Sector number.
◆ sectorSize()
virtual size_t semf::app::Flash::sectorSize |
( |
size_t |
sector | ) |
const |
|
pure virtual |
Return the size of a sector in bytes.
- Parameters
-
sector | Sector index in a flash memory. |
- Returns
- Size of a sector in bytes.
◆ erased
Signal semf::app::Flash::erased |
The signal is triggered after the pages have been erased completely.
Definition at line 58 of file flash.h.