@@ -59,29 +59,37 @@ class I2CEEBlockDevice : public BlockDevice {
5959public:
6060 /* * Constructor to create an I2CEEBlockDevice on I2C pins
6161 *
62- * @param sda The pin name for the sda line of the I2C bus.
63- * @param scl The pin name for the scl line of the I2C bus.
64- * @param addr The 8bit I2C address of the chip, common range 0xa0 - 0xae.
65- * @param size The size of the device in bytes
66- * @param block The page size of the device in bytes, defaults to 32bytes
67- * @param freq The frequency of the I2C bus, defaults to 400K.
62+ * @param sda The pin name for the sda line of the I2C bus.
63+ * @param scl The pin name for the scl line of the I2C bus.
64+ * @param addr The 8bit I2C address of the chip, common range 0xa0 - 0xae.
65+ * @param size The size of the device in bytes
66+ * @param block The page size of the device in bytes, defaults to 32bytes
67+ * @param freq The frequency of the I2C bus, defaults to 400K.
68+ * @param address_is_eight_bit Specifies whether the EEPROM device is using eight bit
69+ * addresses instead of 16 bit addresses. This should not be needed
70+ * unless dealing with very cheap devices.
6871 */
6972 I2CEEBlockDevice (
7073 PinName sda, PinName scl, uint8_t address,
7174 bd_size_t size, bd_size_t block = 32 ,
72- int bus_speed = 400000 );
75+ int bus_speed = 400000 ,
76+ bool address_is_eight_bit = false );
7377
7478 /* * Constructor to create an I2CEEBlockDevice on I2C pins
75- *
76- * @param i2c The I2C instance pointer
77- * @param addr The 8bit I2C address of the chip, common range 0xa0 - 0xae.
78- * @param size The size of the device in bytes
79- * @param block The page size of the device in bytes, defaults to 32bytes
80- * @param freq The frequency of the I2C bus, defaults to 400K.
81- */
79+ *
80+ * @param i2c The I2C instance pointer
81+ * @param addr The 8bit I2C address of the chip, common range 0xa0 - 0xae.
82+ * @param size The size of the device in bytes
83+ * @param block The page size of the device in bytes, defaults to 32bytes
84+ * @param freq The frequency of the I2C bus, defaults to 400K.
85+ * @param address_is_eight_bit Specifies whether the EEPROM device is using eight bit
86+ * addresses instead of 16 bit addresses. This should not be needed
87+ * unless dealing with very cheap devices.
88+ */
8289 I2CEEBlockDevice (
8390 mbed::I2C *i2c_obj, uint8_t address,
84- bd_size_t size, bd_size_t block = 32 );
91+ bd_size_t size, bd_size_t block = 32 ,
92+ bool address_is_eight_bit = false );
8593
8694 /* * Destructor of I2CEEBlockDevice
8795 */
@@ -169,6 +177,8 @@ class I2CEEBlockDevice : public BlockDevice {
169177 uint32_t _size;
170178 uint32_t _block;
171179
180+ bool _address_is_eight_bit;
181+
172182 int _sync ();
173183};
174184
0 commit comments