You are here

U2C_SetI2cFreq()

U2C_RESULT U2C_SetI2cFreq(
      HANDLE hDevice,
      BYTE Frequency
);

The U2C_SetI2cFreq() function configures I2C bus frequency.

Parameters:

hDevice

Handle to the U2C-12 device.

Frequency

The frequency of I2C bus, where:

  • 0 corresponds to I 2 C bus fast mode (400 kHz).
  • 1 corresponds to I 2 C bus standard mode (100 kHz).
  • 1+n corresponds to clock period of I 2 C bus equal to 10 + 2*n uS.
For convenience following constants were introduced:
U2C_I2C_FREQ_FASTI2C bus fast mode (400 kHz)
U2C_I2C_FREQ_STDI2C bus standard mode (100 kHz)
U2C_I2C_FREQ_83KHZ83 kHz
U2C_I2C_FREQ_71KHZ71 kHz
U2C_I2C_FREQ_62KHZ62 kHz
U2C_I2C_FREQ_50KHZ50 kHz
U2C_I2C_FREQ_25KHZ25 kHz
U2C_I2C_FREQ_10KHZ10 kHz
U2C_I2C_FREQ_5KHZ5 kHz
U2C_I2C_FREQ_2KHZ2 kHz

Return values:

U2C_SUCCESS

The I2C bus frequency value was successfully set.

U2C_HARDWARE_NOT_FOUND

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

Rating: 
No votes yet

Languages

User login