26 #ifndef MBED_PROFILING_BLOCK_DEVICE_H 27 #define MBED_PROFILING_BLOCK_DEVICE_H 29 #include "BlockDevice.h" 75 virtual int read(
void *buffer, bd_addr_t addr, bd_size_t
size);
86 virtual int program(
const void *buffer, bd_addr_t addr, bd_size_t size);
97 virtual int erase(bd_addr_t addr, bd_size_t size);
142 virtual bd_size_t
size()
const;
170 virtual const char *
get_type()
const;
174 bd_size_t _read_count;
175 bd_size_t _program_count;
176 bd_size_t _erase_count;
182 #ifndef MBED_NO_GLOBAL_USING_DIRECTIVE virtual int read(void *buffer, bd_addr_t addr, bd_size_t size)
Read blocks from a block device.
A hardware device capable of writing and reading blocks.
void reset()
Reset the current profile counts to zero.
virtual bd_size_t size() const
Get the total size of the underlying device.
virtual bd_size_t get_program_size() const
Get the size of a programmable block.
virtual bd_size_t get_read_size() const
Get the size of a readable block.
virtual int sync()
Ensure data on storage is in sync with the driver.
ProfilingBlockDevice(BlockDevice *bd)
Lifetime of the memory block device.
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size)
Program blocks to a block device.
virtual ~ProfilingBlockDevice()
Lifetime of a block device.
bd_size_t get_program_count() const
Get number of bytes that have been programed to the block device.
bd_size_t get_erase_count() const
Get number of bytes that have been erased from the block device.
virtual int init()
Initialize a block device.
Block device for measuring storage operations of another block device.
virtual bd_size_t get_erase_size() const
Get the size of an erasable block.
bd_size_t get_read_count() const
Get number of bytes that have been read from the block device.
virtual int get_erase_value() const
Get the value of storage when erased.
virtual const char * get_type() const
Get the BlockDevice class type.
virtual int deinit()
Deinitialize a block device.
virtual int erase(bd_addr_t addr, bd_size_t size)
Erase blocks on a block device.