semf
flash.h
Go to the documentation of this file.
1
10#ifndef SEMF_APP_STORAGE_FLASH_H_
11#define SEMF_APP_STORAGE_FLASH_H_
12
14#include <cstddef>
15
16namespace semf
17{
18namespace app
19{
23class Flash : public Storage
24{
25public:
26 virtual ~Flash() = default;
27
33 virtual void erase(size_t sector, size_t numOfSectors = 1) = 0;
40 virtual size_t sector(uint32_t address) const = 0;
46 virtual uint32_t address(size_t sector) const = 0;
52 virtual size_t sectorSize(size_t sector) const = 0;
56 virtual size_t numberOfSectors() const = 0;
57
59};
60} /* namespace app */
61} /* namespace semf */
62#endif /* SEMF_APP_STORAGE_FLASH_H_ */
Signal for lightweight signal/slot implementation. One signal can be connected to multiple slots and ...
Definition: signal.h:41
Interface for flash storage.
Definition: flash.h:24
virtual uint32_t address(size_t sector) const =0
Return on which address a sector starts.
virtual void erase(size_t sector, size_t numOfSectors=1)=0
Erase sector(s).
virtual size_t sector(uint32_t address) const =0
Return in which sector an address is located.
Signal erased
Definition: flash.h:58
virtual size_t numberOfSectors() const =0
Return the number/amount of sectors of a flash memory.
virtual size_t sectorSize(size_t sector) const =0
Return the size of a sector in bytes.
virtual ~Flash()=default
Interface for using storage memories/devices (e.g. FLASH or EEPROM).
Definition: storage.h:25