You are here

U2C_GetClockSynchTimeout()

U2C_RESULT U2C_GetClockSynchTimeout(
      HANDLE hDevice,
      WORD* pTimeout
);

The U2C_GetClockSynchTimeout() function retrieves timeout value for I2C bus clock synchronization.

Clock synchronization (clock stretching) is used in situations where I2C slave device is not able to cooperate on the clock speed provided by the U2C-12 I2C master and needs to slow down the I2C bus. I2C slave holds down the SCL line low and in that way signals the I2C master about a wait state. To avoid waiting deadlock (if some problem occurs with I2C slave device) timeout value was introduced into U2C-12 I2C interface. If I2C slave device doesn't release the clock within the given timeout interval, U2C-12 adapter returns the U2C_I2C_CLOCK_SYNCH_TIMEOUT error value.

[Warning]Warning
I 2 C bus clock synchronization (clock stretching) is implemented for I 2 C bus frequencies up to 100kHz. See U2C_SetI2cFreq() to learn how to change I 2 C bus frequency.

Parameters:

hDevice

Handle to the U2C-12 device.

pTimeout

Pointer to variable to be filled with clock synchronization timeout value.

Return values:

U2C_SUCCESS

The I2C bus clock synchronization timeout value was successfully retrieved.

U2C_HARDWARE_NOT_FOUND

U2C-12 device referenced by hDevice handle was not found.

Rating: 
No votes yet

Languages

User login