19#ifndef MBED_MEM_BLOCK_DEVICE_H
20#define MBED_MEM_BLOCK_DEVICE_H
22#include "BlockDevice.h"
23#include "platform/mbed_assert.h"
163 uint32_t _init_ref_count;
164 bool _is_initialized;
172#ifndef MBED_NO_GLOBAL_USING_DIRECTIVE
A hardware device capable of writing and reading blocks.
Lazily allocated heap-backed block device.
virtual const char * get_type() const
Get the BlockDevice class type.
HeapBlockDevice(bd_size_t size, bd_size_t block=512)
Lifetime of the memory block device.
virtual int erase(bd_addr_t addr, bd_size_t size)
Erase blocks on a block device.
virtual bd_size_t get_program_size() const
Get the size of a programmable block.
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size)
Program blocks to a block device.
virtual bd_size_t get_erase_size() const
Get the size of an erasable block.
virtual int deinit()
Deinitialize a block device.
virtual bd_size_t get_read_size() const
Get the size of a readable block.
virtual bd_size_t size() const
Get the total size of the underlying device.
HeapBlockDevice(bd_size_t size, bd_size_t read, bd_size_t program, bd_size_t erase)
Lifetime of the memory block device.
virtual int read(void *buffer, bd_addr_t addr, bd_size_t size)
Read blocks from a block device.
virtual int init()
Initialize a block device.
virtual bd_size_t get_erase_size(bd_addr_t addr) const
Get the size of an erasable block given address.
uint64_t bd_size_t
Type representing a quantity of 8-bit bytes.
uint64_t bd_addr_t
Type representing the address of a specific block.