U2C_RESULT U2C_SpiSetConfigEx( HANDLE hDevice, DWORD Config );
The U2C_SpiSetConfigEx() function enables/disables and configures SPI interface.
Parameters:
- hDevice
Handle to the U2C-12 device.
- Config
SPI configuration bits:
- 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.
- Bit 0: CPOL bit - Clock polarity. Determines the CLK line idle state:
Return values:
U2C_SUCCESS
SPI bus was successfully configured.
U2C_HARDWARE_NOT_FOUND
U2C-12 device referenced by hDevice handle was not found.