U2C_SpiGetFreq()

U2C_RESULT U2C_SpiGetFreq(
      HANDLE hDevice,
      BYTE* pFrequency
);

The U2C_SpiGetFreq() function obtains SPI bus frequency.

Parameters:

hDevice

Handle to the U2C-12 device.

pFrequency

A pointer to byte to be filled with the current SPI bus frequency, where:

  • 0 corresponds to SPI bus frequency of 200 kHz.
  • 1 corresponds to SPI bus frequency of 100 kHz.
  • 1+n corresponds to the SPI bus clock period equal to 10 + 2*n uS.
For convenience following constants were introduced:
U2C_SPI_FREQ_200KHZ200 kHz
U2C_SPI_FREQ_100KHZ100 kHz
U2C_SPI_FREQ_83KHZ83 kHz
U2C_SPI_FREQ_71KHZ71 kHz
U2C_SPI_FREQ_62KHZ62 kHz
U2C_SPI_FREQ_50KHZ50 kHz
U2C_SPI_FREQ_25KHZ25 kHz
U2C_SPI_FREQ_10KHZ10 kHz
U2C_SPI_FREQ_5KHZ5 kHz
U2C_SPI_FREQ_2KHZ2 kHz

Return values:

U2C_SUCCESS

The SPI bus frequency value was successfully retrieved.

U2C_HARDWARE_NOT_FOUND

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

Rating: 
Голосов пока нет