Dimax English Dimax French Dimax English Dimax Translations
USB-I2C/SPI/GPIO Interface Adapter - U2C-12
Reference Manual

U2C_SpiGetConfigEx


U2C_RESULT U2C_SpiGetConfigEx (
            HANDLE hDevice,
             DWORD* pConfig
);
 

The U2C_SpiGetConfigEx function obtains SPI configuration.

Parameters:
hDevice Handle to the U2C-12 device.
pConfig A pointer to DWORD to be filled with current SPI configuration:
  • Bit 0: CPOL bit - Clock polarity. Determines the CLK line idle state:
    • 0 corresponds to idle low
    • 1 corresponds to idle high
  • Bit 1: CPHA bit - Clock phase. Determines the valid data clock edge:
    • 0 corresponds to valid data available on leading edge
    • 1 corresponds to valid data available on trailing edge
  • Bit 2: SPI Disable bit.
    • 0 corresponds to SPI Enable. MOSI and CLK pins are outputs.
    • 1 corresponds to SPI Disable. All SPI interface pins are inputs.
  • Bits 3..31: Reserved Bits, should be 0.
Return values:
U2C_SUCCESS The SPI bus configuration was successfully obtained.
U2C_HARDWARE_NOT_FOUND U2C-12 device referenced by hDevice handle was not found.
            Copyright DIMAX 2002-2012