18#ifndef MBED_FLASHIAP_BLOCK_DEVICE_H
19#define MBED_FLASHIAP_BLOCK_DEVICE_H
24#include "blockdevice/BlockDevice.h"
25#include "platform/mbed_toolchain.h"
27#ifndef MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS
28#define MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS 0xFFFFFFFF
31#ifndef MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE
32#define MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE 0
47 uint32_t
size = MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE);
153 bool _is_initialized;
154 uint32_t _init_ref_count;
BlockDevice using the FlashIAP API.
virtual const char * get_type() const
Get the BlockDevice class type.
virtual mbed::bd_size_t get_read_size() const
Get the size of a readable block.
virtual int read(void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size)
Read blocks from a block device.
virtual int program(const void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size)
Program blocks to a block device.
virtual bool is_valid_erase(mbed::bd_addr_t addr, mbed::bd_size_t size) const
Convenience function for checking block erase validity.
virtual mbed::bd_size_t get_program_size() const
Get the size of a programable block.
virtual mbed::bd_size_t size() const
Get the total size of the underlying device.
virtual mbed::bd_size_t get_erase_size() const
Get the size of a eraseable block.
virtual int deinit()
Deinitialize a block device.
virtual int erase(mbed::bd_addr_t addr, mbed::bd_size_t size)
Erase blocks on a block device.
FlashIAPBlockDevice(uint32_t address=0xFFFFFFFF, uint32_t size=0)
Creates a FlashIAPBlockDevice.
virtual int init()
Initialize a block device.
virtual mbed::bd_size_t get_erase_size(mbed::bd_addr_t addr) const
Get the size of an erasable block given address.
virtual int get_erase_value() const
Get the value of storage when erased.
A hardware device capable of writing and reading blocks.
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.