-
Notifications
You must be signed in to change notification settings - Fork 3k
storage: Add the I2C EEPROM block device #3564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i2c block device - LGTM
I assume we are waiting for blockdevice integration
I think this PR is currently blocked pending resolution of the #3671 review. |
for (int i = 0; i < I2CEEPROM_TIMEOUT; i++) { | ||
_i2c.start(); | ||
int ack = _i2c.write(_i2c_address | 0); | ||
_i2c.stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_i2c.write(_i2c_address | 0, 0, 0) could be used instead here.
In case of start / write(byte), there is no way for the driver to know whether a another byte will be written next.
With the write(address, buf, length) API, this is clear that this is a check for availability of the device (length is 0).
We need this info for some of the stm32 device to have the check working ok..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @LMESTM, thanks for pointing this out.
I think I may be misunderstanding a part of the I2C protocol. Doesn't every byte that is sent over I2C get an ack?
marking as do not merge until dependent PR is merged |
@LMESTM are you happy with this now ? |
This has been moved out to here: Feel free to raise any remaining issues on that repo, thanks 👍 |
Adds support for I2CEepromBlockDevice, a block device driver to support I2C EEPROMs like Microchip's 24LC range and AMTELS AT24C range.
This is a fork of the I2CEeprom driver by Robin Hourahane on the developer site:
https://developer.mbed.org/users/rhourahane/code/I2CEeprom/
This provides support for small I2C EEPROM devices around the 32k byte range. Note, these chips may be too small to support the FATFileSystem which requires a minimum of 64k bytes.
This driver should follow the life-cycle of the SDCardBlockDevice, and move into its own repo before this feature-branch is merged.
dependent on #3671
relevant commit range 3440cd7...geky:bd-i2ceeprom
cc @simonqhughes, @c1728p9, @theotherjimmy