12 #ifndef INCLUDE_DISTORTOS_DEVICES_MEMORY_MEMORYTECHNOLOGYDEVICE_HPP_ 13 #define INCLUDE_DISTORTOS_DEVICES_MEMORY_MEMORYTECHNOLOGYDEVICE_HPP_ 53 virtual int close() = 0;
68 virtual int erase(uint64_t address, uint64_t size) = 0;
92 virtual uint64_t
getSize()
const = 0;
109 virtual void lock() = 0;
119 virtual int open() = 0;
137 virtual int program(uint64_t address,
const void* buffer,
size_t size) = 0;
153 virtual int read(uint64_t address,
void* buffer,
size_t size) = 0;
175 virtual void unlock() = 0;
186 #endif // INCLUDE_DISTORTOS_DEVICES_MEMORY_MEMORYTECHNOLOGYDEVICE_HPP_ virtual int erase(uint64_t address, uint64_t size)=0
Erases blocks on a device.
virtual size_t getProgramBlockSize() const =0
virtual size_t getEraseBlockSize() const =0
virtual ~MemoryTechnologyDevice()=default
MemoryTechnologyDevice's destructor.
virtual void lock()=0
Locks the device for exclusive use by current thread.
Definition: MemoryTechnologyDevice.hpp:30
virtual uint64_t getSize() const =0
virtual int read(uint64_t address, void *buffer, size_t size)=0
Reads data from a device.
virtual void unlock()=0
Unlocks the device which was previously locked by current thread.
Top-level namespace of distortos project.
Definition: buttons.hpp:33
virtual int close()=0
Closes device.
virtual size_t getReadBlockSize() const =0
virtual int program(uint64_t address, const void *buffer, size_t size)=0
Programs data to a device.
virtual int open()=0
Opens device.
virtual int synchronize()=0
Synchronizes state of a device, ensuring all cached writes are finished.