RTEMS  5.1
Functions

Functions

ALT_STATUS_CODE alt_i2c_sda_hold_time_get (ALT_I2C_DEV_t *i2c_dev, uint16_t *hold_time)
 
ALT_STATUS_CODE alt_i2c_sda_hold_time_set (ALT_I2C_DEV_t *i2c_dev, const uint16_t hold_time)
 

Detailed Description

The I2C protocol specification requires 300ns of hold time on the SDA signal in standard and fast speed modes. Board delays on the SCL and SDA signals can mean that the hold-time requirement is met at the I2C master, but not at the I2C slave (or vice-versa). Because each system may encounter differing board signal delays, the I2C controller provides the capability to adjust of the SDA hold-time.

The functions in this section provide software configuration of SDA hold time for the I2C controller.

Function Documentation

◆ alt_i2c_sda_hold_time_get()

ALT_STATUS_CODE alt_i2c_sda_hold_time_get ( ALT_I2C_DEV_t i2c_dev,
uint16_t *  hold_time 
)

Gets the currently configured value for the SDA hold time in I2C controller clock (ALT_CLK_L4_SP) clock ticks.

Parameters
i2c_devA pointer to the I2C controller device block instance.
hold_time[out] The configured SDA hold time in ALT_CLK_L4_SP clock ticks.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code

◆ alt_i2c_sda_hold_time_set()

ALT_STATUS_CODE alt_i2c_sda_hold_time_set ( ALT_I2C_DEV_t i2c_dev,
const uint16_t  hold_time 
)

Sets the configured value for the SDA hold time in terms of I2C controller clock (ALT_CLK_L4_SP) clock ticks.

Parameters
i2c_devA pointer to the I2C controller device block instance.
hold_timeThe SDA hold time in ALT_CLK_L4_SP clock ticks.
Return values
ALT_E_SUCCESSSuccessful status.
ALT_E_ERRORDetails about error status code