Skip to content

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

Closed
wants to merge 1 commit into from

Conversation

geky
Copy link
Contributor

@geky geky commented Jan 10, 2017

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

@geky geky changed the title storage: Add the I2CEEPROM block device storage: Add the I2C EEPROM block device Jan 10, 2017
Copy link
Contributor

@0xc0170 0xc0170 left a 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

@simonqhughes
Copy link
Contributor

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();
Copy link
Contributor

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..

Copy link
Contributor Author

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?

@adbridge
Copy link
Contributor

marking as do not merge until dependent PR is merged

@adbridge
Copy link
Contributor

@LMESTM are you happy with this now ?

@geky
Copy link
Contributor Author

geky commented Feb 21, 2017

This has been moved out to here:
https://github.com/armmbed/i2ceeprom-driver

Feel free to raise any remaining issues on that repo, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants