i2cdriver icon indicating copy to clipboard operation
i2cdriver copied to clipboard

feat(i2c): add baud rate setting functionality

Open muman613 opened this issue 1 year ago • 1 comments

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 avatar Jun 06 '24 18:06 muman613

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

muman613 avatar Jun 06 '24 18:06 muman613

Merged, thanks.

jamesbowman avatar Mar 12 '25 21:03 jamesbowman