-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Drivers: i2c: target eeprom extra api #96918
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
base: main
Are you sure you want to change the base?
Drivers: i2c: target eeprom extra api #96918
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.
Thanks! A few comments below:
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.
A couple minor doxygen mistakes. thanks!
b0061a2 to
c0f24a0
Compare
|
Changes since v1:
|
c0f24a0 to
78cb854
Compare
|
Changes since v2:
|
For some use cases it can be interesting to know when the eeprom has been written to by the I2C host (E.G. once a stop has been received after a write transaction), so add a "changed" callback. Multiple EEPROM instances are supported, so pass the device and user data as arguments to the callback. Signed-off-by: Peter Korsgaard <[email protected]>
For some use cases it can be interesting to know how big the EEPROM is, so add a getter for it. Signed-off-by: Peter Korsgaard <[email protected]>
The current functions to access the EEPROM data are not ideal, E.G.: - eeprom_target_program() is hard coded to write to the beginning of the EEPROM data - eeprom_target_read() reads a single byte, so large overhead to read all data So as an alternative, add an interface similar to what is provided by zephyr/drivers/eeprom.h, E.G. functions taking an offset and and length. Signed-off-by: Peter Korsgaard <[email protected]>
78cb854 to
4006a1a
Compare
…ta() eeprom_target_program() is about to become deprecated as it does not take an offset argument, so switch to eeprom_target_write_data() instead. Signed-off-by: Peter Korsgaard <[email protected]>
It does not provide an offset argument, so suggest eeprom_target_write_data() instead. Signed-off-by: Peter Korsgaard <[email protected]>
It is not very handy that the EEPROM stops responding after 1 second, so drop that. Signed-off-by: Peter Korsgaard <[email protected]>
And show the usages of the new _get_size() / _get_data() getters. Signed-off-by: Peter Korsgaard <[email protected]>
4006a1a to
33696a3
Compare
|
Changes since v4:
|
|
comment addressed - thank you (sorry that I can't really provide an actual review :|)



For some use cases it can be interesting to know when the eeprom has been written to by the I2C host (E.G. once a stop has been received after a write transaction), so add a "changed" callback.
The existing API for accessing the EEPROM data is not ideal, so add getters for the size and data instead and update the sample the use the new APIs