26.2.2.4 i2c_m_os_set_baudrate
Set baudrate.
int32_t i2c_m_os_set_baudrate(
struct i2c_m_os_desc *const i2c,
uint32_t clkrate,
uint32_t baudrate
)
This function sets the I2C master device to a specified baudrate, and it only takes effect when the hardware is disabled
Parameters
- i2c
-
Type: struct i2c_m_os_desc Struct *const
An I2C master descriptor, which is used to communicate through I2C
- clkrate
-
Type: uint32_t
Unused parameter, should always be 0
- baudrate
-
Type: uint32_t
The baudrate value set to master
Returns
Type: int32_t
The status whether successfully set the baudrate
- -1
-
The passed parameters were invalid or the device is already enabled
- 0
-
The baudrate set is completed successfully