Silicon Labs Host Libraries
IOP Library

Data Structures

struct  SILABS_IOP_ACCESSORY_INFO
 Accessory Information. More...
 
struct  SILABS_IOP_PORT_CONFIGURATION
 Port Configuration. More...
 
struct  SILABS_IOP_DIGITAL_PORT_VALUE
 Digital Port Value. More...
 
struct  SILABS_IOP_ANALOG_PIN_VALUE
 Analog Pin Value. More...
 
struct  SILABS_IOP_SERIAL_STATE
 Serial State. More...
 

Macros

#define SLABIOPLIB_API
 Silabs IOP lib API. More...
 
#define WINAPI
 WIN API. More...
 

Enumerations

enum  SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS { SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IDLE = ((uint8_t)(0xFF & 0x00)), SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_UART = ((uint8_t)(0xFF & 0x01)), SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP = ((uint8_t)(0xFF & 0x02)), SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_UNKNOWN = ((uint8_t)(0xFF & 0xFF)) }
 
enum  DEVICE_I2C_STATUS {
  DEVICE_I2C_STATUS_SUCCESS = (0), DEVICE_I2C_STATUS_BUS_ERROR = (0xFF), DEVICE_I2C_STATUS_BUS_BUSY = (0xFE), DEVICE_I2C_STATUS_TIMEOUT = (0xFD),
  DEVICE_I2C_STATUS_INVALID_PARAMETER = (0xFC), DEVICE_I2C_STATUS_CFG_LOCKED = (0xFA)
}
 

Functions

SILABS_STATUS IOP_GetDeviceManufacturerString (const HANDLE hHandle, char *pDeviceString, const size_t DeviceStringLenInBytes, size_t *pLenInBytes)
 Return the device-defined string containing the name of the manufacturer of this device. More...
 
SILABS_STATUS IOP_GetDeviceProductString (const HANDLE hHandle, char *pDeviceString, const size_t DeviceStringLenInBytes, size_t *pLenInBytes)
 Return the device-defined string that contains a description of the device. More...
 
SILABS_STATUS IOP_GetDeviceSerialNumberString (const HANDLE hHandle, char *pDeviceString, const size_t DeviceStringLenInBytes, size_t *pLenInBytes)
 Return the device-defined string that contains a manufacturer-determined serial number for the device. More...
 
SILABS_STATUS IOP_GetDeviceFirmwareVersionString (const HANDLE hHandle, char *pDeviceString, const size_t DeviceStringLenInBytes, size_t *pLenInBytes)
 Return the device-defined string that contains a manufacturer-determined Firmware Version for the device. More...
 

Exported API Functions

SILABS_STATUS IOP_GetLibraryVersion (uint8_t *major, uint8_t *minor, BOOL *pbIsReleaseBuild)
 Reads and returns the interface library version from the DLL or static library. More...
 
SILABS_STATUS IOP_GetNumDevices (const uint16_t Vid, const uint16_t Pid, uint32_t *pNumDevices)
 Determines the number of devices of interest connected to the system. More...
 
SILABS_STATUS IOP_GetDevicePathString (const uint32_t DeviceIndex, char *pDevicePathString, const size_t DevicePathStringLenInBytes, size_t *pLenInBytes)
 return the device instance's DevicePath string More...
 
SILABS_STATUS IOP_GetVIDPIDFromDevicePath (const uint32_t DeviceIndex, uint16_t *pVid, uint16_t *pPid)
 derives the device instance's VID and PID from the device instance's DevicePath returned by IOP_GetDevicePathString() More...
 
SILABS_STATUS IOP_GetSerialNumberStringFromDevicePath (const uint32_t DeviceIndex, char *pSerialNumberString, const size_t SerialNumberStringLenInBytes, size_t *pLenInBytes)
 derives the device instance's Serial Number string from the device instance's DevicePath returned by IOP_GetDevicePathString() More...
 
SILABS_STATUS IOP_Open (const uint32_t DeviceIndex, PHANDLE pHandle)
 Opens a handle to the device. More...
 
SILABS_STATUS IOP_OpenByDevicePath (const char *pDevicePath, PHANDLE pHandle)
 Opens a handle to the device. More...
 
SILABS_STATUS IOP_Close (const HANDLE hHandle)
 Closes an open handle to the device. More...
 
SILABS_STATUS IOP_GetCurrentAlternateSetting (const HANDLE hHandle, SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS *pAlternateSettingNumber)
 Returns an indication of the current Alternate Setting in use. More...
 
SILABS_STATUS IOP_SetCurrentAlternateSetting (const HANDLE hHandle, const SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS AlternateSettingNumber)
 Set the current Alternate Setting on the device. More...
 
SILABS_STATUS IOP_SetCurrentAlternateSettingIDLE (const HANDLE hHandle)
 Set the current Alternate Setting on the device to IDLE. More...
 
SILABS_STATUS IOP_SetCurrentAlternateSettingUART (const HANDLE hHandle)
 Set the current Alternate Setting on the device to UART. More...
 
SILABS_STATUS IOP_SetCurrentAlternateSettingIOP (const HANDLE hHandle)
 Set the current Alternate Setting on the device to IOP. More...
 

UART interface functions

SILABS_STATUS IOP_Read (const HANDLE hHandle, uint8_t *pBuffer, const size_t BufferLenInBytes, size_t *pBytesRead, LPOVERLAPPED o=NULL)
 Reads from the device into a buffer. More...
 
SILABS_STATUS IOP_Write (const HANDLE hHandle, uint8_t *pBuffer, const size_t BufferLenInBytes, size_t *pBytesWritten, LPOVERLAPPED o=NULL)
 Write buffer to device. More...
 

IOP interface functions

SILABS_STATUS IOP_GetAccessoryInfo (const HANDLE hHandle, SILABS_IOP_ACCESSORY_INFO *pAccessoryInfo)
 Returns accessory identification information of the device. More...
 
SILABS_STATUS IOP_GetPortConfiguration (const HANDLE hHandle, const uint8_t PortNumber, SILABS_IOP_PORT_CONFIGURATION *pPortConfiguration)
 Returns pin configuration for digital port of the device. More...
 
SILABS_STATUS IOP_GetDigitalPort (const HANDLE hHandle, const uint8_t PortNumber, const uint16_t PinMask, SILABS_IOP_DIGITAL_PORT_VALUE *pDigitalPortValue)
 Returns current digital port value of the device. More...
 
SILABS_STATUS IOP_SetDigitalPort (const HANDLE hHandle, const uint8_t PortNumber, SILABS_IOP_DIGITAL_PORT_VALUE *pDigitalPortValue)
 writes one or more digital output pins in a port. More...
 
SILABS_STATUS IOP_GetAnalogPin (const HANDLE hHandle, const uint8_t PinNumber, SILABS_IOP_ANALOG_PIN_VALUE *pAnalogPinValue)
 Returns current analog pin value of the device. More...
 
SILABS_STATUS IOP_GetSerialState (const HANDLE hHandle, SILABS_IOP_SERIAL_STATE *pSerialState)
 Returns error status for serial session. More...
 
SILABS_STATUS IOP_DoI2CTransfer (const HANDLE hHandle, const uint8_t SlaveAddress, _In_reads_bytes_opt_(WriteMsgLength) const uint8_t *WriteMsg, const uint8_t WriteMsgLength, uint8_t *ReadMsg, const uint8_t ReadMsgLength, uint8_t *pNumBytesRead, DEVICE_I2C_STATUS *pDeviceI2CStatus)
 Requests that the specified I2C transfer be completed and the results returned. More...
 

Detailed Description

The Silicon Labs CP2615 USB Digital Audio Bridge is a composite USB device that provides three USB interfaces:

0. USB HID Class consumer controls (volume, mute and playback buttons)

  1. USB serial data bridge (vendor specific, not a USB standard class)
  2. USB Audio Class 1.0 to I2S digital audio bridge

The HID and Audio interfaces are standard class implementations that are natively supported by the host OS (e.g.Android, Windows). The USB serial data bridge is a vendor specific interface and is accessed via this slabiop host interface library.

The USB serial data bridge interface has three alternate settings SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS:

0 SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IDLE. IDLE - has no endpoints and is used to disable the IO link. 1 SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_UART. UART - has one Bulk IN and one Bulk OUT endpoint for transporting UART data. 2 SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP. IOP - has one Bulk IN and one Bulk OUT endpoint for transporting IOP messages.

To exchange IOP messages with the CP2615 device, the application follows these steps:

  1. Locate the CP2615 device by searching for its configured VID and PID. IOP_GetNumDevices()
  2. Open a device handle for the CP2615. IOP_Open()
  3. Locate the IO interface by comparing interface class and subclass values.
  4. Use the host API to claim the interface.
  5. Use the host API to set the interface to alternate setting 2 (IOP). IOP_SetCurrentAlternateSettingIOP()
  6. Use the host API to transfer IOP messages over the interface's bulk pipes.

The IOP protocol includes the message iop_DoI2cTransfer IOP_DoI2CTransfer(), which is used to implement an I2C bridge over the CP2615. This message requests the CP2615 to perform a master I2C transfer. Depending on the slave I2C address, the transfer is completed on the physical I2C bus or to a virtual EEPROM implemented by the CP2615. The virtual EEPROM is at slave address 0xF2 and adheres to the protocol described in the configuration mode section of the CP2615 datasheet.

Note
all slabiop IOP Library strings are UTF-8 encoded

Data Structure Documentation

◆ SILABS_IOP_ACCESSORY_INFO

struct SILABS_IOP_ACCESSORY_INFO

Accessory Information.

Data Fields
uint16_t OptionID Customer specified value read from the configuration.
uint16_t PartID Encoded part number of the chip (0x1400 for CP2615 Rev 1.0).
uint16_t ProtocolVersion IOP protocol version.

◆ SILABS_IOP_PORT_CONFIGURATION

struct SILABS_IOP_PORT_CONFIGURATION

Port Configuration.

Data Fields
uint16_t PinDirection Bitmask: 0 = Input, 1 = Output.
uint16_t PinFunction Bitmask: 0 = Alternate, 1 = GPIO.
uint16_t PinOutMode Bitmask: 0 = Open-Drain, 1 = Push-Pull.
uint8_t PortNumber The target digital port.

◆ SILABS_IOP_DIGITAL_PORT_VALUE

struct SILABS_IOP_DIGITAL_PORT_VALUE

Digital Port Value.

Data Fields
uint16_t PinMask Bitmask indicates which pins changed or were queried by the iop_GetDigitalPort message.
uint8_t PortNumber The target digital port.
uint16_t PortValue Bitfield returns current digital pin values (all pins are returned).

◆ SILABS_IOP_ANALOG_PIN_VALUE

struct SILABS_IOP_ANALOG_PIN_VALUE

Analog Pin Value.

Data Fields
uint8_t PinNumber The target analog pin.
uint16_t PinValue Value read from the analog pin. (10-bit right-justified, Vdd fullscale for CP2615)
uint32_t TimeStamp 32-bit Timestamp. 1 msec resolution.

◆ SILABS_IOP_SERIAL_STATE

struct SILABS_IOP_SERIAL_STATE

Serial State.

Data Fields
uint8_t ReceiveError Receive stream errors. 0 = no errors, non-zero = receive overflow.

Macro Definition Documentation

◆ SLABIOPLIB_API

#define SLABIOPLIB_API

Silabs IOP lib API.

◆ WINAPI

#define WINAPI

WIN API.

Enumeration Type Documentation

◆ DEVICE_I2C_STATUS

Enumerator
DEVICE_I2C_STATUS_SUCCESS 

I2C transfer completed without errors.

DEVICE_I2C_STATUS_BUS_ERROR 

I2C bus error (NAK received).

DEVICE_I2C_STATUS_BUS_BUSY 

I2C bus was busy.

DEVICE_I2C_STATUS_TIMEOUT 

I2C transfer timed out (slave did not respond).

DEVICE_I2C_STATUS_INVALID_PARAMETER 

Parameter error (read or write count out of range).

DEVICE_I2C_STATUS_CFG_LOCKED 

Writing to configuration memory failed because the configuration is locked.

◆ SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS

Enumerator
SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IDLE 

Idle. Has no endpoints and is used to disable the IO link.

SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_UART 

UART. Has one Bulk IN and one Bulk OUT endpoint for transporting UART data.

SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP 

I/O Protocol. Has one Bulk IN and one Bulk OUT endpoint for transporting IOP messages.

SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_UNKNOWN 

an unknown Alternate Settings

Function Documentation

◆ IOP_Close()

SILABS_STATUS IOP_Close ( const HANDLE  hHandle)

Closes an open handle to the device.

After a successful close the handle is no longer valid.

Parameters
[in]hHandleis an open handle to the device
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle or an not-IsOpened handle
SILABS_STATUS_UNKNOWN_ERROR– an unknown error occured trying to close the open device handle. Internal OS error?

◆ IOP_DoI2CTransfer()

SILABS_STATUS IOP_DoI2CTransfer ( const HANDLE  hHandle,
const uint8_t  SlaveAddress,
_In_reads_bytes_opt_(WriteMsgLength) const uint8_t *  WriteMsg,
const uint8_t  WriteMsgLength,
uint8_t *  ReadMsg,
const uint8_t  ReadMsgLength,
uint8_t *  pNumBytesRead,
DEVICE_I2C_STATUS pDeviceI2CStatus 
)

Requests that the specified I2C transfer be completed and the results returned.

This requests that the specified I2C transfer be completed and the results returned. The transfer consists of a write cycle followed by a read cycle. Either the write or the read cycle may be skipped by setting the associated byte count to 0. Transfer status and any data read from the I2C bus is returned in an iop_I2cTransferResult message

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingIOP().
Parameters
[in]hHandleis an handle to the device
[in]SlaveAddressis the I2C slave address
[in]WriteMsgis the I2C write data
[in]WriteMsgLengthis the Number of bytes to write. Set to 0 for read-only transfer. (Max value is 54 for CP2615)
[out]ReadMsgpoints at a ReadMsgLength-bytes sized buffer into which the I2C read data is returned
[in]ReadMsgLengthis the Number of bytes to read. Set to 0 for write-only transfer. (Max value is 54 for CP2615)
[out]pNumBytesReadpoints at a 1-byte sized buffer into which the actual number of read uint8_ts is written on successful returns
[out]pDeviceI2CStatusstatus of i2c device return
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_INVALID_PARAMETER– SlaveAddress, WriteMsg, WriteMsgLength, ReadMsg, ReadMsgLength or pNumuint8_tsRead is invalid
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not IOP
SILABS_STATUS_TBD– I2C Transfer resulted in an Error state from the device ()
SILABS_STATUS_DEVICE_ERROR_TIMEOUT– device-side timed out the operation

◆ IOP_GetAccessoryInfo()

SILABS_STATUS IOP_GetAccessoryInfo ( const HANDLE  hHandle,
SILABS_IOP_ACCESSORY_INFO pAccessoryInfo 
)

Returns accessory identification information of the device.

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingIOP().
Parameters
[in]hHandleis an handle to the device
[out]pAccessoryInfopoints at a SILABS_IOP_ACCESSORY_INFO sized buffer into which the accessory identification information is returned
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pAccessoryInfo is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not IOP

◆ IOP_GetAnalogPin()

SILABS_STATUS IOP_GetAnalogPin ( const HANDLE  hHandle,
const uint8_t  PinNumber,
SILABS_IOP_ANALOG_PIN_VALUE pAnalogPinValue 
)

Returns current analog pin value of the device.

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingIOP().
Parameters
[in]hHandleis an handle to the device
[in]PinNumberis the analog pin to query
[out]pAnalogPinValuepoints at a SILABS_IOP_ANALOG_PIN_VALUE sized buffer into which the current analog pin value is returned
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pAnalogPinValue is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not IOP

◆ IOP_GetCurrentAlternateSetting()

SILABS_STATUS IOP_GetCurrentAlternateSetting ( const HANDLE  hHandle,
SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS pAlternateSettingNumber 
)

Returns an indication of the current Alternate Setting in use.

Parameters
[in]hHandleis an handle to the device
[out]pAlternateSettingNumberpoints at a SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS sized buffer into which the current alternate setting for is returned
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pAlternateSettingNumber is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle

◆ IOP_GetDeviceFirmwareVersionString()

SILABS_STATUS IOP_GetDeviceFirmwareVersionString ( const HANDLE  hHandle,
char *  pDeviceString,
const size_t  DeviceStringLenInBytes,
size_t *  pLenInBytes 
)

Return the device-defined string that contains a manufacturer-determined Firmware Version for the device.

Parameters
[in]hHandleis an handle to the device
[out]pDeviceStringpoints at a buffer into which the device-defined string containing the Firmware Version of this device will be copied and returned
[in]DeviceStringLenInBytesthe length in bytes of pDeviceString the buffer into which the Firmware Version string will be copied and returned
[out]pLenInBytespoints at a size_t-sized location into which the length of the returned string will be copied and returned
Note
all strings are UTF-8 encoded, nul-terminated
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_INVALID_PARAMETER– pDeviceString or DeviceStringLenInuint8_ts is invalid

◆ IOP_GetDeviceManufacturerString()

SILABS_STATUS IOP_GetDeviceManufacturerString ( const HANDLE  hHandle,
char *  pDeviceString,
const size_t  DeviceStringLenInBytes,
size_t *  pLenInBytes 
)

Return the device-defined string containing the name of the manufacturer of this device.

Parameters
[in]hHandleis an handle to the device
[out]pDeviceStringpoints at a buffer into which the device-defined string containing the name of the manufacturer of this device will be copied and returned
[in]DeviceStringLenInBytesthe length in bytes of pDeviceString the buffer into which the manufacturer string will be copied and returned
[out]pLenInBytespoints at a size_t-sized location into which the length of the returned string will be copied and returned
Note
all strings are UTF-8 encoded, nul-terminated
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_INVALID_PARAMETER– pDeviceString or DeviceStringLenInuint8_ts is invalid

◆ IOP_GetDevicePathString()

SILABS_STATUS IOP_GetDevicePathString ( const uint32_t  DeviceIndex,
char *  pDevicePathString,
const size_t  DevicePathStringLenInBytes,
size_t *  pLenInBytes 
)

return the device instance's DevicePath string

Note
By observation, DevicePath looks like this: "\\\\?\\usb#vid_10c4&pid_ea60#0001#{a2a39220-39f4-4b88-aecb-3d86a35dc748}"
todo insert reference to Windows/MSDN web site describing that
Parameters
[in]DeviceIndexis the desired device's index into the device list used to determine IOP_GetNumDevices()
[out]pDevicePathStringpoints at a buffer into which the DevicePath string will be copied and returned
[in]DevicePathStringLenInBytesthe length in bytes of pDevicePathString the buffer into which the DevicePath string will be copied and returned
[out]pLenInBytespoints at a size_t-sized location into which the length of the returned string will be copied and returned
Note
all strings are UTF-8 encoded, nul-terminated
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pDevicePathString or DevicePathStringLenInBytes is invalid

◆ IOP_GetDeviceProductString()

SILABS_STATUS IOP_GetDeviceProductString ( const HANDLE  hHandle,
char *  pDeviceString,
const size_t  DeviceStringLenInBytes,
size_t *  pLenInBytes 
)

Return the device-defined string that contains a description of the device.

Parameters
[in]hHandleis an handle to the device
[out]pDeviceStringpoints at a buffer into which the device-defined string that contains a description of the device will be copied and returned
[in]DeviceStringLenInBytesthe length in bytes of pDeviceString the buffer into which the description of the device string will be copied and returned
[out]pLenInBytespoints at a size_t-sized location into which the length of the returned string will be copied and returned
Note
all strings are UTF-8 encoded, nul-terminated
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_INVALID_PARAMETER– pDeviceString or DeviceStringLenInBytes is invalid

◆ IOP_GetDeviceSerialNumberString()

SILABS_STATUS IOP_GetDeviceSerialNumberString ( const HANDLE  hHandle,
char *  pDeviceString,
const size_t  DeviceStringLenInBytes,
size_t *  pLenInBytes 
)

Return the device-defined string that contains a manufacturer-determined serial number for the device.

Parameters
[in]hHandleis an handle to the device
[out]pDeviceStringpoints at a buffer into which the device-defined string containing the serial number of this device will be copied and returned
[in]DeviceStringLenInBytesthe length in bytes of pDeviceString the buffer into which the serial number string will be copied and returned
[out]pLenInBytespoints at a size_t-sized location into which the length of the returned string will be copied and returned
Note
all strings are UTF-8 encoded, nul-terminated
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_INVALID_PARAMETER– pDeviceString or DeviceStringLenInuint8_ts is invalid

◆ IOP_GetDigitalPort()

SILABS_STATUS IOP_GetDigitalPort ( const HANDLE  hHandle,
const uint8_t  PortNumber,
const uint16_t  PinMask,
SILABS_IOP_DIGITAL_PORT_VALUE pDigitalPortValue 
)

Returns current digital port value of the device.

This requests the current value for the specified digital port. The PinMask parameter is copied into the returned SILABS_IOP_DIGITAL_PORT_VALUE and not interpreted..

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingIOP().
Parameters
[in]hHandleis an handle to the device
[in]PortNumberis the digital port to query
[in]PinMaskis a bitmask indicates which pins changed or were queried
[out]pDigitalPortValuepoints at a SILABS_IOP_DIGITAL_PORT_VALUE sized buffer into which the current digital port value is returned
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pDigitalPortValue is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not IOP

◆ IOP_GetLibraryVersion()

SILABS_STATUS IOP_GetLibraryVersion ( uint8_t *  major,
uint8_t *  minor,
BOOL *  pbIsReleaseBuild 
)

Reads and returns the interface library version from the DLL or static library.

Parameters
[out]majorpoints at a uint8_t-sized buffer into which the major version number of the interface library Version value will be written
[out]minorpoints at a uint8_t-sized buffer into which the minor version number of the interface library Version value will be written
[out]pbIsReleaseBuildpoints at a _Bool-sized buffer into which a boolean value of whether this is a Release build of the interface library will be written (true for Release build, false for Debug builds)
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– major or minor or pbIsReleaseBuild are an unexpected values

◆ IOP_GetNumDevices()

SILABS_STATUS IOP_GetNumDevices ( const uint16_t  Vid,
const uint16_t  Pid,
uint32_t *  pNumDevices 
)

Determines the number of devices of interest connected to the system.

Parameters
[in]Vidis the USB VID of any devices of interest
[in]Pidis the USB PID of any devices of interest
[out]pNumDevicesa pointer to a uint32_t/4-uint8_t location to hold the returned device count
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pNumDevices is an unexpected value

◆ IOP_GetPortConfiguration()

SILABS_STATUS IOP_GetPortConfiguration ( const HANDLE  hHandle,
const uint8_t  PortNumber,
SILABS_IOP_PORT_CONFIGURATION pPortConfiguration 
)

Returns pin configuration for digital port of the device.

This requests the pin configuration data for all pins in the specified port.

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingIOP().
Parameters
[in]hHandleis an handle to the device
[in]PortNumberis the port to query
[out]pPortConfigurationpoints at a SILABS_IOP_PORT_CONFIGURATION sized buffer into which the accessory identification information is returned
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pPortConfiguration is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not IOP

◆ IOP_GetSerialNumberStringFromDevicePath()

SILABS_STATUS IOP_GetSerialNumberStringFromDevicePath ( const uint32_t  DeviceIndex,
char *  pSerialNumberString,
const size_t  SerialNumberStringLenInBytes,
size_t *  pLenInBytes 
)

derives the device instance's Serial Number string from the device instance's DevicePath returned by IOP_GetDevicePathString()

Parameters
[in]DeviceIndexis the desired device's index into the device list used to determine IOP_GetNumDevices()
[out]pSerialNumberStringpoints at a buffer into which the Serial Number string will be copied and returned
[in]SerialNumberStringLenInBytesthe length in bytes of pSerialNumberString the buffer into which the Serial Number string will be copied and returned
[out]pLenInBytespoints at a size_t-sized location into which the length of the returned string will be copied and returned
Note
all strings are UTF-8 encoded, nul-terminated
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pSerialNumberString or SerialNumberStringLenInBytes is invalid

◆ IOP_GetSerialState()

SILABS_STATUS IOP_GetSerialState ( const HANDLE  hHandle,
SILABS_IOP_SERIAL_STATE pSerialState 
)

Returns error status for serial session.

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingIOP().
Parameters
[in]hHandleis an handle to the device
[out]pSerialStatepoints at a SILABS_IOP_SERIAL_STATE sized buffer into which the error status for serial session is returned
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pSerialState is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not IOP

◆ IOP_GetVIDPIDFromDevicePath()

SILABS_STATUS IOP_GetVIDPIDFromDevicePath ( const uint32_t  DeviceIndex,
uint16_t *  pVid,
uint16_t *  pPid 
)

derives the device instance's VID and PID from the device instance's DevicePath returned by IOP_GetDevicePathString()

Parameters
[in]DeviceIndexis the desired device's index into the device list used to determine IOP_GetNumDevices()
[out]pVidpoints to a 2-byte buffer into which the device's Vendor ID will be returned
[out]pPidpoints to a 2-byte buffer into which the device's Product ID will be returned
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pSerialNumberString or SerialNumberStringLenInBytes is invalid

◆ IOP_Open()

SILABS_STATUS IOP_Open ( const uint32_t  DeviceIndex,
PHANDLE  pHandle 
)

Opens a handle to the device.

Parameters
[in]DeviceIndexis the desired device's index into the device list used to determine IOP_GetNumDevices()
[out]pHandleis a pointer to a HANDLE/4-uint8_t location to hold the returned open handle to the device
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pHandle is invalid

◆ IOP_OpenByDevicePath()

SILABS_STATUS IOP_OpenByDevicePath ( const char *  pDevicePath,
PHANDLE  pHandle 
)

Opens a handle to the device.

Parameters
[in]pDevicePathis the desired device's DevicePath.
[out]pHandleis a pointer to a HANDLE/4-uint8_t location to hold the returned open handle to the device
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pHandle is invalid

◆ IOP_Read()

SILABS_STATUS IOP_Read ( const HANDLE  hHandle,
uint8_t *  pBuffer,
const size_t  BufferLenInBytes,
size_t *  pBytesRead,
LPOVERLAPPED  o = NULL 
)

Reads from the device into a buffer.

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_UART for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingUART().
Parameters
[in]hHandleis an handle to the device
[in]pBufferpoints at a buffer into which bytes will be read from the device
[in]BufferLenInBytesis the size in bytes bytes of that buffer into which bytes will be read from the device
[out]pBytesReadis the number of bytes read from the device and placed into the buffer
[in]ois ...
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pAccessoryInfo is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not UART

◆ IOP_SetCurrentAlternateSetting()

SILABS_STATUS IOP_SetCurrentAlternateSetting ( const HANDLE  hHandle,
const SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS  AlternateSettingNumber 
)

Set the current Alternate Setting on the device.

Parameters
[in]hHandleis an handle to the device
[in]AlternateSettingNumberis the new desired Alternate Setting Number SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS to configure the device with
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– AlternateSettingNumber is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle

◆ IOP_SetCurrentAlternateSettingIDLE()

SILABS_STATUS IOP_SetCurrentAlternateSettingIDLE ( const HANDLE  hHandle)

Set the current Alternate Setting on the device to IDLE.

Parameters
[in]hHandleis an handle to the device
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle

◆ IOP_SetCurrentAlternateSettingIOP()

SILABS_STATUS IOP_SetCurrentAlternateSettingIOP ( const HANDLE  hHandle)

Set the current Alternate Setting on the device to IOP.

Parameters
[in]hHandleis an handle to the device
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle

◆ IOP_SetCurrentAlternateSettingUART()

SILABS_STATUS IOP_SetCurrentAlternateSettingUART ( const HANDLE  hHandle)

Set the current Alternate Setting on the device to UART.

Parameters
[in]hHandleis an handle to the device
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle

◆ IOP_SetDigitalPort()

SILABS_STATUS IOP_SetDigitalPort ( const HANDLE  hHandle,
const uint8_t  PortNumber,
SILABS_IOP_DIGITAL_PORT_VALUE pDigitalPortValue 
)

writes one or more digital output pins in a port.

This writes one or more digital output pins in a port. The PinMask determines which pins will be written. If a target pin is not a digital output, the pin is not written.

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_IOP for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingIOP().
Parameters
[in]hHandleis an handle to the device
[in]PortNumberis the digital port to set
[in]pDigitalPortValuepoints at a SILABS_IOP_DIGITAL_PORT_VALUE sized buffer describing which pins will be written
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pDigitalPortValue is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not IOP

◆ IOP_Write()

SILABS_STATUS IOP_Write ( const HANDLE  hHandle,
uint8_t *  pBuffer,
const size_t  BufferLenInBytes,
size_t *  pBytesWritten,
LPOVERLAPPED  o = NULL 
)

Write buffer to device.

Note
The Current Alternate Setting of the device must be set to SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS_UART for successful operation of this function see IOP_SetCurrentAlternateSetting() or IOP_SetCurrentAlternateSettingUART().
Parameters
[in]hHandleis an handle to the device
[in]pBufferpoints at a buffer containing the data to be written to the device
[in]BufferLenInBytesis the number of bytes in that buffer to be written to the device
[out]pBytesWrittenis the number of bytes from that buffer successfully written to the device
[in]ois ...
Returns
Returns SILABS_STATUS_SUCCESS on success, or another SILABS_STATUS Return value if there is an error.
Return values
SILABS_STATUS_SUCCESS– success
SILABS_STATUS_INVALID_PARAMETER– pAccessoryInfo is invalid
SILABS_STATUS_INVALID_HANDLE– hHandle an invalid handle
SILABS_STATUS_DEVICE_ERROR_STATE– device is not in the correct state to perform this operation, including the possibility that the device's CurrentAlternateSetting is not UART