Skip to content
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

feat(i2c): add baud rate setting functionality #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

muman613
Copy link

@muman613 muman613 commented Jun 6, 2024

Add a new function i2c_setbaud allowing the baud rate of the I2C connection to be set. This feature provides the ability to configure the communication speed to standard values (100kbps or 400kbps). To support this, stdbool.h is included for returning boolean status from the new function. The implementation checks if the requested baud rate matches the current one, and updates it if necessary through a serialized command, with feedback obtained immediately by calling i2c_getstatus. This commit includes both the prototype in i2cdriver.h and the definition in i2cdriver.c.

Add a new function `i2c_setbaud` allowing the baud rate of the I2C connection to be set. This feature provides the ability to configure the communication speed to standard values (100kbps or 400kbps). To support this, `stdbool.h` is included for returning boolean status from the new function. The implementation checks if the requested baud rate matches the current one, and updates it if necessary through a serialized command, with feedback obtained immediately by calling `i2c_getstatus`. This commit includes both the prototype in `i2cdriver.h` and the definition in `i2cdriver.c`.
@muman613
Copy link
Author

muman613 commented Jun 6, 2024

@jamesbowman , please review the code and comment if you think there is anything which needs to be changed. I have tested this code, but you should test it if you have C code using the SDK...

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

Successfully merging this pull request may close these issues.

2 participants