-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
drivers: esp32: i2c: configure clock speed during runtime #72380
drivers: esp32: i2c: configure clock speed during runtime #72380
Conversation
maass-hamburg
commented
May 6, 2024
- configure clock speed during runtime
- implement get_config of the i2c api
d88a62b
to
9a57437
Compare
ping @sylvioalves |
drivers/i2c/i2c_esp32.c
Outdated
@@ -262,13 +261,13 @@ static int i2c_esp32_recover(const struct device *dev) | |||
return 0; | |||
} | |||
|
|||
static void IRAM_ATTR i2c_esp32_configure_timeout(const struct device *dev) | |||
static void IRAM_ATTR i2c_esp32_configure_timeout(const struct device *dev, uint32_t bitrate) |
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.
It sounds a bit strange to configure bit-rate in a configure_timeout
function. I would either embed this into i2c_esp32_configure()
or create a new i2c_esp32_configure_bitrate()
function. How does it sound? I guess 1st option is a bit straighforward.
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.
fair point.
I now also moved the data mode part in a separate function, which is now only executed in the init, as it is set by the device tree and isn't changing during runtime.
9a57437
to
6c68fbf
Compare
@maass-hamburg can you please squash the commits into a single one? |
6c68fbf
to
687aece
Compare
@marekmatej is done. |
well, renaming the |
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.
Could you please update the commit message, so it has a better description of the changes, and more importantly how to use this new feature?
Be able to configure the clock frequency during runtime using `i2c_configure()` and be able to use `i2c_get_config()` of the i2c api for the esp32. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
687aece
to
444ccf8
Compare