26 #ifndef MBED_FLASH_SIM_BLOCK_DEVICE_H    27 #define MBED_FLASH_SIM_BLOCK_DEVICE_H    29 #include "BlockDevice.h"    34     BD_ERROR_NOT_ERASED       = -3201,
    78     virtual int read(
void *buffer, bd_addr_t addr, bd_size_t 
size);
    89     virtual int program(
const void *buffer, bd_addr_t addr, bd_size_t size);
    99     virtual int erase(bd_addr_t addr, bd_size_t size);
   137     virtual bd_size_t 
size() 
const;
   143     virtual const char *
get_type() 
const;
   146     uint8_t _erase_value;
   147     bd_size_t _blank_buf_size;
   150     uint32_t _init_ref_count;
   151     bool _is_initialized;
   157 #ifndef MBED_NO_GLOBAL_USING_DIRECTIVE virtual int read(void *buffer, bd_addr_t addr, bd_size_t size)
Read blocks from the block device. 
virtual int program(const void *buffer, bd_addr_t addr, bd_size_t size)
Program blocks to the block device. 
virtual bd_size_t get_erase_size() const 
Get the size of an erasable block. 
A hardware device capable of writing and reading blocks. 
Flash simulating block device. 
virtual bd_size_t size() const 
Get the total size of the underlying device. 
virtual int deinit()
Deinitialize the block device. 
FlashSimBlockDevice(BlockDevice *bd, uint8_t erase_value=0xFF)
Constructor. 
virtual const char * get_type() const 
Get the BlockDevice class type. 
virtual int erase(bd_addr_t addr, bd_size_t size)
Erase blocks on the block device. 
virtual int get_erase_value() const 
Get the value of storage when erased. 
virtual int init()
Initialize a block device. 
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. 
virtual bd_size_t get_program_size() const 
Get the size of a programmable block.