| SLAB_USB_SPI 1.0 Silicon Labs CP2130 USB-to-SPI Interface Library

- Main Page
- Data Structures
- Files

- File List
- Globals

Functions
SLAB_USB_SPI.cpp File Reference

## Functions
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetLibraryVersion (BYTE *pMajor, BYTE *pMinor, BOOL *pIsRelease)
| Get the Interface Library version numbers. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetGuid (LPGUID pDevGuid)
| Return the GUID used for device managment. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetGuid (LPGUID pDevGuid)
| Set the GUID used for device managment. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_Reset (CP213x_DEVICE hDevice)
| Reset device. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetRtrStop (CP213x_DEVICE hDevice, BYTE stopRtr)
| Stop 'Read with RTR' operation. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetRtrState (CP213x_DEVICE hDevice, BYTE *inRtrMode)
| Read status of RTR operation. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetDeviceVersion (CP213x_DEVICE hDevice, BYTE *majorVersion, BYTE *minorVersion)
| Get the read-only device version. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetSpiControlByte (CP213x_DEVICE hDevice, BYTE channel, BYTE controlByte)
| Set the SPI control word. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetSpiControlBytes (CP213x_DEVICE hDevice, BYTE controlBytes[CP213x_NUM_GPIO])
| Get the SPI control word. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetSpiDelay (CP213x_DEVICE hDevice, BYTE channel, BYTE delayMode, WORD interByteDelay, WORD postAssertDelay, WORD preDeassertDelay)
| Set the SPI delay values. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetSpiDelay (CP213x_DEVICE hDevice, BYTE channel, BYTE *delayMode, WORD *interByteDelay, WORD *postAssertDelay, WORD *preDeassertDelay)
| Get the SPI delay values. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetFifoFullThreshold (CP213x_DEVICE hDevice, BYTE fifoFullThreshold)
| Set the FIFO full threshold. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetFifoFullThreshold (CP213x_DEVICE hDevice, BYTE *pFifoFullThreshold)
| Get the FIFO full threshold value. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetChipSelect (CP213x_DEVICE hDevice, BYTE channel, BYTE mode)
| Set SPI chip select control word. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetChipSelect (CP213x_DEVICE hDevice, WORD *channelCsEnable, WORD *pinCsEnable)
| Get SPI chip select control word. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetGpioModeAndLevel (CP213x_DEVICE hDevice, BYTE index, BYTE mode, BYTE level)
| Set the GPIO mode control. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetGpioModeAndLevel (CP213x_DEVICE hDevice, BYTE channel, BYTE *mode, BYTE *level)
| Get the GPIO mode control. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetGpioValues (CP213x_DEVICE hDevice, WORD mask, WORD gpioValues)
| Set the GPIO values. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetGpioValues (CP213x_DEVICE hDevice, WORD *gpioValues)
| Get the GPIO values. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetEventCounter (CP213x_DEVICE hDevice, BYTE mode, WORD count)
| Set the Event Count value. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetEventCounter (CP213x_DEVICE hDevice, BYTE *mode, WORD *count)
| Get the Event Count value. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetClockDivider (CP213x_DEVICE hDevice, BYTE clockDivider)
| Set clock divider. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetClockDivider (CP213x_DEVICE hDevice, BYTE *pClockDivider)
| Get clock divider. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_ControlTransfer (CP213x_DEVICE hDevice, SETUP_PACKET SetupPacket, PUCHAR Buffer, PULONG LengthTransferred)
| Perform a USB control transfer. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_TransferWrite (CP213x_DEVICE hDevice, BYTE pWriteBuf[], DWORD length, BOOL releaseBusAfterTransfer, DWORD timeoutMs, DWORD *pBytesActuallyWritten)
| Perform SPI Write. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_TransferReadSync (CP213x_DEVICE hDevice, BYTE pReadBuf[], DWORD length, BOOL releaseBusAfterTransfer, DWORD timeoutMs, DWORD *pBytesActuallyRead)
| Perform SPI Read (synchronous) More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_TransferWriteRead (CP213x_DEVICE hDevice, BYTE pWriteBuf[], BYTE pReadBuf[], DWORD length, BOOL releaseBusAfterTransfer, DWORD timeoutMs, DWORD *pBytesActuallyTransferred)
| Perform SPI Write/Read (synchronous) More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_TransferReadRtrSync (CP213x_DEVICE hDevice, BYTE pReadBuf[], DWORD totalSize, DWORD blockSize, BOOL releaseBusAfterTransfer, DWORD timeoutMs, DWORD *pBytesActuallyRead)
| Perform SPI Read with RTR (synchronous) More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_TransferReadRtrAsync (CP213x_DEVICE hDevice, DWORD totalSize, DWORD blockSize, BOOL releaseBusAfterTransfer)
| Perform SPI Read with RTR (asynchronous) More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_TransferReadAsync (CP213x_DEVICE hDevice, DWORD totalSize, DWORD blockSize, BOOL releaseBusAfterTransfer)
| Perform SPI Read (asynchronous) More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_ReadPoll (CP213x_DEVICE hDevice, BYTE pReadBuf[], DWORD maxLength, DWORD *pBytesActuallyRead)
| Read bytes received during an asynchronous Read or ReadRTR operation. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_ReadAbort (CP213x_DEVICE hDevice)
| Abort an asynchronous Read or ReadRTR operation. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetLock (CP213x_DEVICE hDevice, WORD lockValue)
| Set the Lock values. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetLock (CP213x_DEVICE hDevice, WORD *lockValue)
| Get the Lock values. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetUsbConfig (CP213x_DEVICE hDevice, WORD vid, WORD pid, BYTE power, BYTE powerMode, WORD releaseVersion, BYTE transferPriority, BYTE mask)
| Set the USB device Configuration info. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetUsbConfig (CP213x_DEVICE hDevice, WORD *vid, WORD *pid, BYTE *power, BYTE *powerMode, WORD *releaseVersion, BYTE *transferPriority)
| Get the USB Device Configuration info. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetManufacturingString (CP213x_DEVICE hDevice, LPSTR manufacturingString, BYTE *strlen)
| Get the USB device Manufacturer string. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetManufacturingString (CP213x_DEVICE hDevice, LPCSTR manufacturingString, BYTE strlen)
| Set the USB device Manufacturer string. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetProductString (CP213x_DEVICE hDevice, LPSTR productString, BYTE *strlen)
| Get the USB device Product string. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetProductString (CP213x_DEVICE hDevice, LPCSTR productString, BYTE strlen)
| Set the USB device Product string. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetSerialString (CP213x_DEVICE hDevice, LPSTR serialString, BYTE *strlen)
| Get the USB device Serial Number string. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetSerialString (CP213x_DEVICE hDevice, LPCSTR serialString, BYTE strlen)
| Set the USB device Serial Number string. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetPinConfig (CP213x_DEVICE hDevice, BYTE *pinConfig)
| Get the USB device Pin Configuration info. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_SetPinConfig (CP213x_DEVICE hDevice, BYTE pinConfig[SIZE_PIN_CONFIG])
| Set the USB device Pin Configuration info. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_ReadProm (CP213x_DEVICE hDevice, BYTE pRbuffer[])
| Read device EPROM configuration. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_WriteProm (CP213x_DEVICE hDevice, BYTE pWbuffer[])
| Write device EPROM configuration. More...
Device Management Functions
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetNumDevices (DWORD *numDevices)
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetDevicePath (DWORD deviceIndex, LPSTR path)
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetVidPid (DWORD deviceIndex, WORD *vid, WORD *pid)
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetOpenedDevicePath (CP213x_DEVICE device, LPSTR path)
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetOpenedVidPid (CP213x_DEVICE device, WORD *vid, WORD *pid)
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_OpenByIndex (DWORD deviceIndex, CP213x_DEVICE *device)
| Opens a USB device using a device index and returns a device object pointer which will be used for subsequent access. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_OpenByDevicePath (LPCSTR devicePath, CP213x_DEVICE *phDevice)
| Open device using specified Device Path. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_Close (CP213x_DEVICE hDevice)
| Close device handle. More...
SLAB_USB_SPI_API BOOL WINAPI | CP213x_IsOpened (CP213x_DEVICE device)
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetDeviceDescriptor (CP213x_DEVICE hDevice, PDEVICE_DESCRIPTOR pDescriptor)
| Get specified device descriptor. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_GetStringDescriptor (CP213x_DEVICE hDevice, BYTE index, BYTE stringDescriptor[STRING_DESCRIPTOR_SIZE])
| Get specified string descriptor. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_AbortInputPipe (CP213x_DEVICE hDevice)
| Abort USB input pipe. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_FlushInputPipe (CP213x_DEVICE hDevice)
| Flush USB input pipe. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_AbortOutputPipe (CP213x_DEVICE hDevice)
| Abort USB output pipe. More...
SLAB_USB_SPI_API USB_SPI_STATUS WINAPI | CP213x_FlushOutputPipe (CP213x_DEVICE hDevice)
| Flush USB output pipe. More...

## Function Documentation

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetLibraryVersion | ( | BYTE * | pMajor,
|  | BYTE * | pMinor,
|  | BOOL * | pIsRelease
| ) |  |

Get the Interface Library version numbers.

Parameters

  [out] | pMajor | Major release number
  [out] | pMinor | Minor release number
  [out] | pIsRelease | 0: Not released version, 1: Released version

Returns
  USB_SPI_ERRCODE_SUCCESS

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetGuid | ( | LPGUID | pDevGuid | ) |

Return the GUID used for device managment.

Parameters

  [out] | pDevGuid | Pointer to DEVGUID struct

Returns
  USB_SPI_ERRCODE_SUCCESS

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetGuid | ( | LPGUID | pDevGuid | ) |

Set the GUID used for device managment.

Application must call GetNumDevices() after the GUID is changed.

Parameters

  [in] | pDevGuid | Pointer to DEVGUID struct

Returns
  USB_SPI_ERRCODE_SUCCESS

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetNumDevices | ( | DWORD * | numDevices | ) |

Returns the number of CP213x devices connected to the system

Parameters

  [in] | numDevices | A return value of 0 indicates that no devices are available. Otherwise this parameter returns the number of connected devices. When refering to a device by `deviceIndex`, the index may range from 0 to (CP213x_GetNumDevices() - 1).

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_PARAMETER

Remarks
  This function returns the number of connected devices. This does not imply that a device is not already in use. Users must call CP213x_GetNumDevices() before calling any function that takes a device index parameter in order to build an up to date device list. If a device is installed or removed after calling CP213x_GetNumDevices(), then the device list will be out of date, and the results may be unpredictable.

Note
  CP213x_GetNumDevices() must be called prior to calling:
  CP213x_OpenByIndex()

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_OpenByIndex | ( | DWORD | deviceIndex,
|  | CP213x_DEVICE * | device
| ) |  |

Opens a USB device using a device index and returns a device object pointer which will be used for subsequent access.

Parameters

  [in] | deviceIndex | Index of device to open
  [out] | device | Returns a pointer to a device object used for subsequent device access.

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_DEVICE_OBJECT
  USB_SPI_ERRCODE_INVALID_PARAMETER

Note
  CP213x_GetNumDevices() must be called prior to calling this function in order to initialize the library's internal device list.

See Also
  CP213x_GetNumDevices()

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_OpenByDevicePath | ( | LPCSTR | devicePath,
|  | CP213x_DEVICE * | phDevice
| ) |  |

Open device using specified Device Path.

Parameters

  [in] | devicePath | The specified Device Path
  [out] | phDevice | [Pointer to device handle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_INVALID_DEVICE_OBJECT

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_Close | ( | CP213x_DEVICE | hDevice | ) |

Close device handle.

Parameters

  [in] | hDevice | Pointer to device handle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_DEVICE_OBJECT

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetDeviceDescriptor | ( | CP213x_DEVICE | hDevice,
|  | PDEVICE_DESCRIPTOR | pDescriptor
| ) |  |

Get specified device descriptor.

Parameters

  [in] | hDevice | Interface Handle
  [out] | pDescriptor | Pointer to device descriptor

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_ALLOC_FAILURE
  USB_SPI_ERRCODE_UNKNOWN_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetStringDescriptor | ( | CP213x_DEVICE | hDevice,
|  | BYTE | index,
|  | BYTE | stringDescriptor[STRING_DESCRIPTOR_SIZE]
| ) |  |

Get specified string descriptor.

Parameters

  [in] | hDevice | Device Handle
  [in] | index | String descriptor index
  [out] | stringDescriptor | String descriptor

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_ALLOC_FAILURE
  USB_SPI_ERRCODE_UNKNOWN_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_AbortInputPipe | ( | CP213x_DEVICE | hDevice | ) |

Abort USB input pipe.

Calls WinUsb_AbortPipe

Parameters

  [in] | hDevice | USB Interface Handle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_PIPE_ABORT_FAIL

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_FlushInputPipe | ( | CP213x_DEVICE | hDevice | ) |

Flush USB input pipe.

Calls WinUsb_FlushPipe

Parameters

  [in] | hDevice | USB Interface Handle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_PIPE_FLUSH_FAIL

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_AbortOutputPipe | ( | CP213x_DEVICE | hDevice | ) |

Abort USB output pipe.

Calls WinUsb_AbortPipe

Parameters

  [in] | hDevice | USB Interface Handle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_PIPE_ABORT_FAIL

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_FlushOutputPipe | ( | CP213x_DEVICE | hDevice | ) |

Flush USB output pipe.

Calls WinUsb_FlushPipe

Parameters

  [in] | hDevice | USB Interface Handle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_PIPE_FLUSH_FAIL

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_Reset | ( | CP213x_DEVICE | hDevice | ) |

Reset device.

Send command to reset the device

Parameters

  [in] | hDevice | USB Interface Handle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetRtrStop | ( | CP213x_DEVICE | hDevice,
|  | BYTE | stopRtr
| ) |  |

Stop 'Read with RTR' operation.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | stopRtr | 0: No effect 1: Stop Read with RTR operation

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetRtrState | ( | CP213x_DEVICE | hDevice,
|  | BYTE * | inRtrMode
| ) |  |

Read status of RTR operation.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | inRtrMode | 0: Device is not in RTR mode 1: Device is in RTR mode

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetDeviceVersion | ( | CP213x_DEVICE | hDevice,
|  | BYTE * | majorVersion,
|  | BYTE * | minorVersion
| ) |  |

Get the read-only device version.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | majorVersion |
  [out] | minorVersion |

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetSpiControlByte | ( | CP213x_DEVICE | hDevice,
|  | BYTE | channel,
|  | BYTE | controlByte
| ) |  |

Set the SPI control word.

Set the SPI control byte for a given channel

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | channel | Channel for which to set SPI control byte
  [in] | controlByte | SPI control byte

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetSpiControlBytes | ( | CP213x_DEVICE | hDevice,
|  | BYTE | controlBytes[CP213x_NUM_GPIO]
| ) |  |

Get the SPI control word.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | controlBytes | Buffer that contains the SPI control bytes for each channel

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetSpiDelay | ( | CP213x_DEVICE | hDevice,
|  | BYTE | channel,
|  | BYTE | delayMode,
|  | WORD | interByteDelay,
|  | WORD | postAssertDelay,
|  | WORD | preDeassertDelay
| ) |  |

Set the SPI delay values.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | channel | SPI channel for which to set delays
  [in] | delayMode |
  [in] | interByteDelay |
  [in] | postAssertDelay |
  [in] | preDeassertDelay |

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetSpiDelay | ( | CP213x_DEVICE | hDevice,
|  | BYTE | channel,
|  | BYTE * | delayMode,
|  | WORD * | interByteDelay,
|  | WORD * | postAssertDelay,
|  | WORD * | preDeassertDelay
| ) |  |

Get the SPI delay values.

Pass the desired SPI channel number in buffer[0]

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | channel | SPI channel for which to get delays
  [out] | delayMode |
  [out] | interByteDelay |
  [out] | postAssertDelay |
  [out] | preDeassertDelay |

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetFifoFullThreshold | ( | CP213x_DEVICE | hDevice,
|  | BYTE | fifoFullThreshold
| ) |  |

Set the FIFO full threshold.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | fifoFullThreshold | The FIFO full threshold value to set

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetFifoFullThreshold | ( | CP213x_DEVICE | hDevice,
|  | BYTE * | pFifoFullThreshold
| ) |  |

Get the FIFO full threshold value.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | pFifoFullThreshold | The FIFO full threshold

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetChipSelect | ( | CP213x_DEVICE | hDevice,
|  | BYTE | channel,
|  | BYTE | mode
| ) |  |

Set SPI chip select control word.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | channel |
  [in] | mode | Chip select mode 0: Idle, 1: Active, 2: Active; all other channels idle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetChipSelect | ( | CP213x_DEVICE | hDevice,
|  | WORD * | channelCsEnable,
|  | WORD * | pinCsEnable
| ) |  |

Get SPI chip select control word.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | channelCsEnable |
  [out] | pinCsEnable |

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetGpioModeAndLevel | ( | CP213x_DEVICE | hDevice,
|  | BYTE | index,
|  | BYTE | mode,
|  | BYTE | level
| ) |  |

Set the GPIO mode control.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | index | GPIO number to configure
  [in] | mode | GPIO mode
  [in] | level | GPIO state [0,1]

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetGpioModeAndLevel | ( | CP213x_DEVICE | hDevice,
|  | BYTE | channel,
|  | BYTE * | mode,
|  | BYTE * | level
| ) |  |

Get the GPIO mode control.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | channel | The GPIO line
  [out] | mode | The mode for the specified GPIO line
  [out] | level | The level for the specified GPIO line

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetGpioValues | ( | CP213x_DEVICE | hDevice,
|  | WORD | mask,
|  | WORD | gpioValues
| ) |  |

Set the GPIO values.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | mask | The mask of which GPIO values to set
  [in] | gpioValues | The GPIO values to set for the specified mask

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetGpioValues | ( | CP213x_DEVICE | hDevice,
|  | WORD * | gpioValues
| ) |  |

Get the GPIO values.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | gpioValues | The GPIO values

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetEventCounter | ( | CP213x_DEVICE | hDevice,
|  | BYTE | mode,
|  | WORD | count
| ) |  |

Set the Event Count value.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | mode | Event Counter mode
  [in] | count | Event count value to set

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetEventCounter | ( | CP213x_DEVICE | hDevice,
|  | BYTE * | mode,
|  | WORD * | count
| ) |  |

Get the Event Count value.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | mode | The current Event Counter mode
  [out] | count | The current Event Counter count

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetClockDivider | ( | CP213x_DEVICE | hDevice,
|  | BYTE | clockDivider
| ) |  |

Set clock divider.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | clockDivider | Clock divider value

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetClockDivider | ( | CP213x_DEVICE | hDevice,
|  | BYTE * | pClockDivider
| ) |  |

Get clock divider.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | pClockDivider | Clock divider value

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_ControlTransfer | ( | CP213x_DEVICE | hDevice,
|  | SETUP_PACKET | SetupPacket,
|  | PUCHAR | Buffer,
|  | PULONG | LengthTransferred
| ) |  |

Perform a USB control transfer.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | SetupPacket | USB Setup Packet
  [in] | Buffer | Data to transfer
  [out] | LengthTransferred | Number of bytes actually transferred

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_TransferWrite | ( | CP213x_DEVICE | hDevice,
|  | BYTE | pWriteBuf[],
|  | DWORD | length,
|  | BOOL | releaseBusAfterTransfer,
|  | DWORD | timeoutMs,
|  | DWORD * | pBytesActuallyWritten
| ) |  |

Perform SPI Write.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | pWriteBuf | Buffer of data to write
  [in] | length | Number of bytes to write
  [in] | releaseBusAfterTransfer | 1: Release buffer after transfer is complete
  [in] | timeoutMs | Timeout (ms)
  [out] | pBytesActuallyWritten | Number of bytes actually written

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_HWIF_TRANSFER_TIMEOUT
  USB_SPI_ERRCODE_PIPE_WRITE_FAIL
  USB_SPI_ERRCODE_INVALID_ENUM_VALUE

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_TransferReadSync | ( | CP213x_DEVICE | hDevice,
|  | BYTE | pReadBuf[],
|  | DWORD | length,
|  | BOOL | releaseBusAfterTransfer,
|  | DWORD | timeoutMs,
|  | DWORD * | pBytesActuallyRead
| ) |  |

Perform SPI Read (synchronous)

This function returns after 'length' bytes have been read, or a timeout or error occurs

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | pReadBuf | Buffer of data to read
  [in] | length | Number of bytes to read
  [in] | releaseBusAfterTransfer | 1: Release buffer after transfer is complete
  [in] | timeoutMs | Timeout (ms)
  [out] | pBytesActuallyRead | Number of bytes actually read

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_HWIF_TRANSFER_TIMEOUT
  USB_SPI_ERRCODE_PIPE_READ_FAIL
  USB_SPI_ERRCODE_INVALID_ENUM_VALUE

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_TransferWriteRead | ( | CP213x_DEVICE | hDevice,
|  | BYTE | pWriteBuf[],
|  | BYTE | pReadBuf[],
|  | DWORD | length,
|  | BOOL | releaseBusAfterTransfer,
|  | DWORD | timeoutMs,
|  | DWORD * | pBytesActuallyTransferred
| ) |  |

Perform SPI Write/Read (synchronous)

This function returns after 'length' bytes have been written and read, or a timeout or error occurs

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | pWriteBuf | Buffer of data to write
  [in] | pReadBuf | Buffer of data to read
  [in] | length | Number of bytes to write and read
  [in] | releaseBusAfterTransfer | Release buf after transfer is complete
  [in] | timeoutMs | Timeout (ms)
  [out] | pBytesActuallyTransferred | Number of bytes actually written and read

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_HWIF_TRANSFER_TIMEOUT
  USB_SPI_ERRCODE_PIPE_WRITE_FAIL
  USB_SPI_ERRCODE_PIPE_READ_FAIL
  USB_SPI_ERRCODE_INVALID_ENUM_VALUE

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_TransferReadRtrSync | ( | CP213x_DEVICE | hDevice,
|  | BYTE | pReadBuf[],
|  | DWORD | totalSize,
|  | DWORD | blockSize,
|  | BOOL | releaseBusAfterTransfer,
|  | DWORD | timeoutMs,
|  | DWORD * | pBytesActuallyRead
| ) |  |

Perform SPI Read with RTR (synchronous)

The device reads SPI data in 'blockSize' chunks while the RTR pin is asserted. This function returns after 'totalSize' bytes have been read, or a timeout or error occurs.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | pReadBuf | Buffer of data to read
  [in] | totalSize | Total number of bytes to read
  [in] | blockSize | Number of bytes to read at a time
  [in] | releaseBusAfterTransfer | 1: Release buffer after transfer is complete
  [in] | timeoutMs | Timeout (ms)
  [out] | pBytesActuallyRead | Number of bytes actually read

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_PIPE_ABORT_FAIL
  USB_SPI_ERRCODE_PIPE_FLUSH_FAIL
  USB_SPI_ERRCODE_HWIF_TRANSFER_TIMEOUT
  USB_SPI_ERRCODE_PIPE_WRITE_FAIL

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_TransferReadRtrAsync | ( | CP213x_DEVICE | hDevice,
|  | DWORD | totalSize,
|  | DWORD | blockSize,
|  | BOOL | releaseBusAfterTransfer
| ) |  |

Perform SPI Read with RTR (asynchronous)

The device reads SPI data in 'blockSize' chunks while the RTR pin is asserted. This function returns immediately. The application should call CP213x_ReadPoll() periodically to read data. When 'totalSize' bytes have been read, the Read operation is terminated. To terminate the operation before then, the application should call 'CP213x_ReadAbort'.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | totalSize | Total number of bytes to read
  [in] | blockSize | Number of bytes to read at a time
  [in] | releaseBusAfterTransfer | Release buf after transfer is complete

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_PARAMETER
  USB_SPI_ERRCODE_READ_THREAD_CREATE_FAILURE
  USB_SPI_ERRCODE_HWIF_TRANSFER_TIMEOUT
  USB_SPI_ERRCODE_INVALID_ENUM_VALUE
  USB_SPI_ERRCODE_PIPE_READ_FAIL
  USB_SPI_ERRCODE_READ_THREAD_START_FAILURE

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_TransferReadAsync | ( | CP213x_DEVICE | hDevice,
|  | DWORD | totalSize,
|  | DWORD | blockSize,
|  | BOOL | releaseBusAfterTransfer
| ) |  |

Perform SPI Read (asynchronous)

The device reads SPI data in 'blockSize' chunks. This function returns immediately. The application should call CP213x_ReadPoll() periodically to read data. When 'totalSize' bytes have been read, the Read operation is terminated. To terminate the operation before then, the application should call 'CP213x_ReadAbort'.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | totalSize | Total number of bytes to read
  [in] | blockSize | Number of bytes to read at a time
  [in] | releaseBusAfterTransfer | Release buf after transfer is complete

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_READ_THREAD_CREATE_FAILURE
  USB_SPI_ERRCODE_PIPE_ABORT_FAIL
  USB_SPI_ERRCODE_PIPE_FLUSH_FAIL
  USB_SPI_ERRCODE_HWIF_TRANSFER_TIMEOUT
  USB_SPI_ERRCODE_PIPE_WRITE_FAIL
  USB_SPI_ERRCODE_READ_THREAD_START_FAILURE

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_ReadPoll | ( | CP213x_DEVICE | hDevice,
|  | BYTE | pReadBuf[],
|  | DWORD | maxLength,
|  | DWORD * | pBytesActuallyRead
| ) |  |

Read bytes received during an asynchronous Read or ReadRTR operation.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | pReadBuf | Buffer of data to read
  [in] | maxLength | Maximum number of bytes to read
  [out] | pBytesActuallyRead | Number of bytes actually read

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_NULL_POINTER
  USB_SPI_ERRCODE_READ_THREAD_NOT_RUNNING

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_ReadAbort | ( | CP213x_DEVICE | hDevice | ) |

Abort an asynchronous Read or ReadRTR operation.

Parameters

  [in] | hDevice | USB Interface Handle

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_NULL_POINTER

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetLock | ( | CP213x_DEVICE | hDevice,
|  | WORD | lockValue
| ) |  |

Set the Lock values.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | lockValue | The Lock values to set

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetLock | ( | CP213x_DEVICE | hDevice,
|  | WORD * | lockValue
| ) |  |

Get the Lock values.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | lockValue | The Lock values

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetUsbConfig | ( | CP213x_DEVICE | hDevice,
|  | WORD | vid,
|  | WORD | pid,
|  | BYTE | power,
|  | BYTE | powerMode,
|  | WORD | releaseVersion,
|  | BYTE | transferPriority,
|  | BYTE | mask
| ) |  |

Set the USB device Configuration info.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | vid | New VID to be set in the device
  [in] | pid | New PID to be set in the device
  [in] | power | New Power to be set in the device
  [in] | powerMode | New Power Mode to be set in the device
  [in] | releaseVersion | New Release version to be set in the device
  [in] | transferPriority | New Transfer priority to be set in the device
  [in] | mask | Mask that represents which of the settings to write to the device

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetUsbConfig | ( | CP213x_DEVICE | hDevice,
|  | WORD * | vid,
|  | WORD * | pid,
|  | BYTE * | power,
|  | BYTE * | powerMode,
|  | WORD * | releaseVersion,
|  | BYTE * | transferPriority
| ) |  |

Get the USB Device Configuration info.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | vid | VID of the device
  [out] | pid | PID of the device
  [out] | power | Power of the device
  [out] | powerMode | Power Mode of the device
  [out] | releaseVersion | Release version of the device
  [out] | transferPriority | Transfer priority of the device

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetManufacturingString | ( | CP213x_DEVICE | hDevice,
|  | LPSTR | manufacturingString,
|  | BYTE * | strlen
| ) |  |

Get the USB device Manufacturer string.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | manufacturingString | Pointer to buffer that will be populated with Manufacturer string
  [out] | strlen | Pointer to BYTE that will be set to the Manufacturer string length

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetManufacturingString | ( | CP213x_DEVICE | hDevice,
|  | LPCSTR | manufacturingString,
|  | BYTE | strlen
| ) |  |

Set the USB device Manufacturer string.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | manufacturingString | Buffer containing the USB device Manufacturer string to be set
  [in] | strlen | The length of the supplied Manufacturer string

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetProductString | ( | CP213x_DEVICE | hDevice,
|  | LPSTR | productString,
|  | BYTE * | strlen
| ) |  |

Get the USB device Product string.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | productString | Buffer that will be populated with the USB device Product string
  [out] | strlen | Pointer to BYTE that will be set to the Product string length

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetProductString | ( | CP213x_DEVICE | hDevice,
|  | LPCSTR | productString,
|  | BYTE | strlen
| ) |  |

Set the USB device Product string.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | productString | Buffer containing the USB device Product string
  [in] | strlen | The length of the supplied Product string

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetSerialString | ( | CP213x_DEVICE | hDevice,
|  | LPSTR | serialString,
|  | BYTE * | strlen
| ) |  |

Get the USB device Serial Number string.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | serialString | Buffer that will be populated with the USB device Serial Number string
  [out] | strlen | Pointer to BYTE that will be set to the Serial Number string length

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetSerialString | ( | CP213x_DEVICE | hDevice,
|  | LPCSTR | serialString,
|  | BYTE | strlen
| ) |  |

Set the USB device Serial Number string.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | serialString | Buffer containing the USB device Serial Number string
  [in] | strlen | The length of the supplied Serial Number string

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_GetPinConfig | ( | CP213x_DEVICE | hDevice,
|  | BYTE * | pinConfig
| ) |  |

Get the USB device Pin Configuration info.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | pinConfig | Buffer containing the USB device Pin Configuration info

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_SetPinConfig | ( | CP213x_DEVICE | hDevice,
|  | BYTE | pinConfig[SIZE_PIN_CONFIG]
| ) |  |

Set the USB device Pin Configuration info.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | pinConfig | Buffer containing the USB device Pin Configuration info

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_ReadProm | ( | CP213x_DEVICE | hDevice,
|  | BYTE | pRbuffer[]
| ) |  |

Read device EPROM configuration.

Parameters

  [in] | hDevice | USB Interface Handle
  [out] | pRbuffer | Pointer to byte array to be filled

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR

SLAB_USB_SPI_API USB_SPI_STATUS WINAPI CP213x_WriteProm | ( | CP213x_DEVICE | hDevice,
|  | BYTE | pWbuffer[]
| ) |  |

Write device EPROM configuration.

Parameters

  [in] | hDevice | USB Interface Handle
  [in] | pWbuffer | Pointer to byte array containing data to write to EPROM

Returns
  USB_SPI_ERRCODE_SUCCESS
  USB_SPI_ERRCODE_INVALID_HANDLE
  USB_SPI_ERRCODE_CONTROL_TRANSFER_ERROR