VitroIO SDK
Software development kit for Vitro Shard.
|
Class is a wrapper for mbed::FlashIAP module. More...
#include <flash_interface.h>
Public Member Functions | |
FlashInterface () | |
Constructor initializes the interface. More... | |
~FlashInterface () | |
Destructor. More... | |
bool | isValid () const |
Function allows to check whether the interface is in valid state. More... | |
int | read (void *buffer, uint32_t offset, uint32_t size) |
Function reads data from flash memory. More... | |
int | write (void *buffer, uint32_t offset, uint32_t size) |
Function writes data to flash memory. More... | |
uint32_t | getMaxSectorSize () const |
Function allows to obtain maximum size of sector in flash memory. More... | |
uint32_t | getSectorSize (uint32_t offset) const |
Function allows to obtain sector size of flash memory for specified address. More... | |
uint32_t | getFlashStartAddress () const |
Function allows to obtain flash memory start address. More... | |
uint32_t | getFlashSize () const |
Function allows to obtain flash memory size in bytes. More... | |
Class is a wrapper for mbed::FlashIAP module.
|
explicit |
Constructor initializes the interface.
There is not guarantee that the object is in valid state. User should call isValid() method to determine if the object was initialized successfully. When the object is in invalid state, the behaviour is undefined.
vitroio::sdk::impl::FlashInterface::~FlashInterface | ( | ) |
Destructor.
uint32_t vitroio::sdk::impl::FlashInterface::getFlashSize | ( | ) | const |
Function allows to obtain flash memory size in bytes.
uint32_t vitroio::sdk::impl::FlashInterface::getFlashStartAddress | ( | ) | const |
Function allows to obtain flash memory start address.
uint32_t vitroio::sdk::impl::FlashInterface::getMaxSectorSize | ( | ) | const |
Function allows to obtain maximum size of sector in flash memory.
Function can be helpful during operations on flash memory. It can help avoid reallocating of memory - only buffer of maximum sector size can be allocated and reused.
uint32_t vitroio::sdk::impl::FlashInterface::getSectorSize | ( | uint32_t | offset | ) | const |
Function allows to obtain sector size of flash memory for specified address.
offset | Flash memory offset. |
bool vitroio::sdk::impl::FlashInterface::isValid | ( | ) | const |
Function allows to check whether the interface is in valid state.
int vitroio::sdk::impl::FlashInterface::read | ( | void * | buffer, |
uint32_t | offset, | ||
uint32_t | size | ||
) |
Function reads data from flash memory.
buffer | Buffer where the data are to be write to. |
offset | Offset of the flash memory where the data are to be read from. |
size | Size of the data to read. |
int vitroio::sdk::impl::FlashInterface::write | ( | void * | buffer, |
uint32_t | offset, | ||
uint32_t | size | ||
) |
Function writes data to flash memory.
buffer | Buffer with data to write. |
offset | Offset of the flash memory where the data are to be write to. |
size | Size of the data to write. |