fsp icon indicating copy to clipboard operation
fsp copied to clipboard

Allow custom clock speeds for I2C

Open alranel opened this issue 1 year ago • 1 comments

Only three speed options are available:

/** Communication speed options */
typedef enum e_i2c_master_rate
{
    I2C_MASTER_RATE_STANDARD = 100000, ///< 100 kHz
    I2C_MASTER_RATE_FAST     = 400000, ///< 400 kHz
    I2C_MASTER_RATE_FASTPLUS = 1000000 ///< 1 MHz
} i2c_master_rate_t;

However, the I2C standard suggest you should allow the best match possible to the requested clock:

The I2C clock can be 0 Hz to 100 kHz, 0 Hz to 400 kHz, 0 Hz to 1 MHz and 0 Hz to 3.4 MHz, depending on the mode. This means that an I2C-bus running at less than 10 kHz is not SMBus compliant since the SMBus devices may time-out.

(This report was posted in the Arduino UNO R4 repository, since other Arduino boards allow users to set any clock within a given range).

alranel avatar Aug 02 '23 10:08 alranel

This is being internally tracked using FSPRA-1487.

renesas-brandon-hussey avatar Jan 19 '24 17:01 renesas-brandon-hussey