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.
@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...
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 callingi2c_getstatus
. This commit includes both the prototype ini2cdriver.h
and the definition ini2cdriver.c
.