17 #ifndef MBED_I2CEEPROM_BLOCK_DEVICE_H    18 #define MBED_I2CEEPROM_BLOCK_DEVICE_H    20 #include "blockdevice/BlockDevice.h"    21 #include "drivers/I2C.h"    74         PinName sda, PinName scl, uint8_t address,
    75         mbed::bd_size_t 
size, mbed::bd_size_t block = 32,
    76         int bus_speed = 400000,
    77         bool address_is_eight_bit = 
false);
    92         mbed::bd_size_t size, mbed::bd_size_t block = 32,
    93         bool address_is_eight_bit = 
false);
   119     virtual int read(
void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size);
   130     virtual int program(
const void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size);
   140     virtual int erase(mbed::bd_addr_t addr, mbed::bd_size_t size);
   166     virtual mbed::bd_size_t 
size() 
const;
   172     virtual const char *
get_type() 
const;
   176     uint32_t _i2c_buffer[
sizeof(
mbed::I2C) / 
sizeof(uint32_t)];
   178     bool _address_is_eight_bit;
   192     uint8_t get_paged_device_address(mbed::bd_addr_t address);
 virtual mbed::bd_size_t get_program_size() const 
Get the size of a programable block. 
A hardware device capable of writing and reading blocks. 
virtual int deinit()
Deinitialize a block device. 
An I2C Master, used for communicating with I2C slave devices. 
virtual mbed::bd_size_t get_read_size() const 
Get the size of a readable block. 
virtual mbed::bd_size_t get_erase_size() const 
Get the size of a eraseable block. 
virtual int init()
Initialize a block device. 
virtual ~I2CEEBlockDevice()
Destructor of I2CEEBlockDevice. 
virtual int erase(mbed::bd_addr_t addr, mbed::bd_size_t size)
Erase blocks on a block device. 
virtual mbed::bd_size_t size() const 
Get the total size of the underlying device. 
virtual int program(const void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size)
Program blocks to a block device. 
virtual const char * get_type() const 
Get the BlockDevice class type. 
virtual int read(void *buffer, mbed::bd_addr_t addr, mbed::bd_size_t size)
Read blocks from a block device. 
I2CEEBlockDevice(PinName sda, PinName scl, uint8_t address, mbed::bd_size_t size, mbed::bd_size_t block=32, int bus_speed=400000, bool address_is_eight_bit=false)
Constructor to create an I2CEEBlockDevice on I2C pins. 
BlockDevice for I2C based flash device such as Microchip's 24LC or ATMEL's AT24C ranges.