16 #ifndef MBED_RSPIF_BLOCK_DEVICE_H 17 #define MBED_RSPIF_BLOCK_DEVICE_H 20 #include "DigitalOut.h" 21 #include "BlockDevice.h" 90 virtual int read(
void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t
size);
101 virtual int program(
const void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size);
111 virtual int erase(mbed::bd_addr_t addr, mbed::bd_size_t size);
139 virtual mbed::bd_size_t
get_erase_size(mbed::bd_addr_t addr)
const;
156 virtual mbed::bd_size_t
size()
const;
162 virtual const char *
get_type()
const;
170 mbed::bd_size_t _size;
175 void _cmdread(uint8_t op, uint32_t addrc, uint32_t retc,
176 uint32_t addr, uint8_t *rets);
177 void _cmdwrite(uint8_t op, uint32_t addrc, uint32_t argc,
178 uint32_t addr,
const uint8_t *args);
virtual int deinit()
Deinitialize a block device.
virtual mbed::bd_size_t size() const
Get the total size of the underlying device.
virtual int init()
Initialize a block device.
A hardware device capable of writing and reading blocks.
virtual mbed::bd_size_t get_erase_size() const
Get the size of a eraseable block.
SPIFReducedBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName csel, int freq=40000000)
Creates a SPIFReducedBlockDevice on a SPI bus specified by pins.
virtual mbed::bd_size_t get_program_size() const
Get the size of a programable block.
virtual int read(void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size)
Read blocks from a block device.
virtual const char * get_type() const
Get the BlockDevice class type.
virtual int get_erase_value() const
Get the value of storage byte after it was erased.
virtual int erase(mbed::bd_addr_t addr, mbed::bd_size_t size)
Erase blocks on a block device.
Reduced BlockDevice for SPI based flash devices Should only be used by Boot Loader ...
virtual mbed::bd_size_t get_read_size() const
Get the size of a readable block.
A digital output, used for setting the state of a pin.
A SPI Master, used for communicating with SPI slave devices.
virtual int program(const void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size)
Program blocks to a block device.