14 #ifndef HOST_LIB_SLABIOP_INCLUDE_SLABIOP_H_INCLUDED_PV1HTEYUPA 15 #define HOST_LIB_SLABIOP_INCLUDE_SLABIOP_H_INCLUDED_PV1HTEYUPA 63 #include "silabs_defs.h" 64 #include "silabs_sal.h" 67 #if defined(SLABIOPLIB_EXPORTS) 68 #define SLABIOPLIB_API 70 #if defined(SILABS_STATIC_LINK_ALL_LIBS) 71 #define SLABIOPLIB_API 72 #pragma comment (lib, "slabiop.static.lib") 73 #else // defined(SILABS_STATIC_LINK_ALL_LIBS) 74 #define SLABIOPLIB_API __declspec(dllimport) 75 #pragma comment (lib, "slabiop.lib") 76 #endif // defined(SILABS_STATIC_LINK_ALL_LIBS) 77 #endif // defined(SLABIOPLIB_EXPORTS) 79 #define SLABIOPLIB_API 85 typedef enum _SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS {
92 _Success_(
return == TRUE)
96 typedef enum _DEVICE_I2C_STATUS {
113 typedef _Struct_size_bytes_(6) struct _SILABS_IOP_ACCESSORY_INFO {
122 typedef _Struct_size_bytes_(7) struct _SILABS_IOP_PORT_CONFIGURATION {
132 typedef _Struct_size_bytes_(5) struct _SILABS_IOP_DIGITAL_PORT_VALUE {
141 typedef _Struct_size_bytes_(7) struct _SILABS_IOP_ANALOG_PIN_VALUE {
150 typedef _Struct_size_bytes_(1) struct _SILABS_IOP_SERIAL_STATE {
166 #endif // __cplusplus 182 _Out_writes_bytes_opt_(
sizeof(uint8_t)) _Pre_defensive_ uint8_t* major,
183 _Out_writes_bytes_opt_(
sizeof(uint8_t)) _Pre_defensive_ uint8_t* minor,
184 _Out_writes_bytes_opt_(
sizeof(BOOL)) _Pre_defensive_ BOOL* pbIsReleaseBuild
202 _In_ _Pre_defensive_
const uint16_t Vid,
203 _In_ _Pre_defensive_
const uint16_t Pid,
204 _Out_writes_bytes_(
sizeof(uint32_t)) _Pre_defensive_ uint32_t *pNumDevices
227 _In_ _Pre_defensive_
const uint32_t DeviceIndex,
228 _Out_writes_bytes_(*pLenInBytes)
char *pDevicePathString,
229 _In_ _Pre_defensive_
const size_t DevicePathStringLenInBytes,
230 _Out_writes_bytes_(
sizeof(
size_t)) _Pre_defensive_
size_t *pLenInBytes
247 _In_ _Pre_defensive_
const uint32_t DeviceIndex,
248 _Out_writes_bytes_(
sizeof(uint16_t)) _Pre_defensive_ uint16_t *pVid,
249 _Out_writes_bytes_(
sizeof(uint16_t)) _Pre_defensive_ uint16_t *pPid
269 _In_ _Pre_defensive_
const uint32_t DeviceIndex,
270 _Out_writes_bytes_(*pLenInBytes)
char *pSerialNumberString,
271 _In_ _Pre_defensive_
const size_t SerialNumberStringLenInBytes,
272 _Out_writes_bytes_(
sizeof(
size_t)) _Pre_defensive_
size_t *pLenInBytes
289 _In_ _Pre_defensive_
const uint32_t DeviceIndex,
290 _Out_writes_bytes_(
sizeof(HANDLE)) _Pre_defensive_ PHANDLE pHandle
306 _In_ _Pre_defensive_
const char *pDevicePath,
307 _Out_writes_bytes_(
sizeof(HANDLE)) _Pre_defensive_ PHANDLE pHandle
325 _In_ _Pre_defensive_
const HANDLE hHandle
342 _In_ _Pre_defensive_
const HANDLE hHandle,
359 _In_ _Pre_defensive_
const HANDLE hHandle,
374 _In_ _Pre_defensive_
const HANDLE hHandle
388 _In_ _Pre_defensive_
const HANDLE hHandle
402 _In_ _Pre_defensive_
const HANDLE hHandle
429 _In_ _Pre_defensive_
const HANDLE hHandle,
430 _Out_writes_bytes_(BufferLenInBytes) uint8_t *pBuffer,
431 _In_range_(0, 222)
const size_t BufferLenInBytes,
432 _Out_range_(0, BufferLenInBytes)
size_t *pBytesRead,
433 _In_opt_ LPOVERLAPPED o = NULL
457 _In_ _Pre_defensive_
const HANDLE hHandle,
458 _In_reads_bytes_(BufferLenInBytes) _Pre_defensive_ uint8_t *pBuffer,
459 _In_range_(0, 222) _Pre_defensive_
const size_t BufferLenInBytes,
460 _Out_range_(0, BufferLenInBytes) _Pre_defensive_
size_t *pBytesWritten,
461 _In_opt_ LPOVERLAPPED o = NULL
487 _In_ _Pre_defensive_
const HANDLE hHandle,
512 _In_ _Pre_defensive_
const HANDLE hHandle,
513 _In_ _Pre_defensive_
const uint8_t PortNumber,
540 _In_ _Pre_defensive_
const HANDLE hHandle,
541 _In_ _Pre_defensive_
const uint8_t PortNumber,
542 _In_ _Pre_defensive_
const uint16_t PinMask,
568 _In_ _Pre_defensive_
const HANDLE hHandle,
569 _In_ _Pre_defensive_
const uint8_t PortNumber,
592 _In_ _Pre_defensive_
const HANDLE hHandle,
593 _In_ _Pre_defensive_
const uint8_t PinNumber,
615 _In_ _Pre_defensive_
const HANDLE hHandle,
651 _In_ _Pre_defensive_
const HANDLE hHandle,
652 _In_ _Pre_defensive_
const uint8_t SlaveAddress,
653 _In_reads_bytes_opt_(WriteMsgLength) _Pre_defensive_
const uint8_t *WriteMsg,
654 _In_opt_ _Pre_defensive_
const uint8_t WriteMsgLength,
655 _Out_writes_bytes_opt_(ReadMsgLength) _Pre_defensive_ uint8_t *ReadMsg,
656 _In_opt_ _Pre_defensive_
const uint8_t ReadMsgLength,
657 _Out_writes_bytes_opt_(
sizeof(uint8_t)) _Pre_defensive_ uint8_t *pNumBytesRead,
683 _In_ _Pre_defensive_
const HANDLE hHandle,
684 _Out_writes_bytes_(DeviceStringLenInBytes)
char *pDeviceString,
685 _In_ _Pre_defensive_
const size_t DeviceStringLenInBytes,
686 _Out_writes_bytes_(
sizeof(
size_t)) _Pre_defensive_
size_t * pLenInBytes
707 _In_ _Pre_defensive_
const HANDLE hHandle,
708 _Out_writes_bytes_(DeviceStringLenInBytes)
char *pDeviceString,
709 _In_ _Pre_defensive_
const size_t DeviceStringLenInBytes,
710 _Out_writes_bytes_(
sizeof(
size_t)) _Pre_defensive_
size_t *pLenInBytes
731 _In_ _Pre_defensive_
const HANDLE hHandle,
732 _Out_writes_bytes_(DeviceStringLenInBytes)
char *pDeviceString,
733 _In_ _Pre_defensive_
const size_t DeviceStringLenInBytes,
734 _Out_writes_bytes_(
sizeof(
size_t)) _Pre_defensive_
size_t * pLenInBytes
756 _In_ _Pre_defensive_
const HANDLE hHandle,
757 _Out_writes_bytes_(DeviceStringLenInBytes)
char *pDeviceString,
758 _In_ _Pre_defensive_
const size_t DeviceStringLenInBytes,
759 _Out_writes_bytes_(
sizeof(
size_t)) _Pre_defensive_
size_t *pLenInBytes
765 #endif // __cplusplus 771 #endif // HOST_LIB_SLABIOP_INCLUDE_SLABIOP_H_INCLUDED_PV1HTEYUPA 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.
Idle. Has no endpoints and is used to disable the IO link.
Definition: slabiop.h:86
SILABS_STATUS IOP_SetCurrentAlternateSetting(const HANDLE hHandle, const SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS AlternateSettingNumber)
Set the current Alternate Setting on the device.
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.
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_GetDe...
SILABS_STATUS IOP_GetSerialState(const HANDLE hHandle, SILABS_IOP_SERIAL_STATE *pSerialState)
Returns error status for serial session.
uint16_t ProtocolVersion
IOP protocol version.
Definition: slabiop.h:116
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.
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.
uint8_t PinNumber
The target analog pin.
Definition: slabiop.h:142
uint8_t ReceiveError
Receive stream errors. 0 = no errors, non-zero = receive overflow.
Definition: slabiop.h:151
#define WINAPI
WIN API.
Definition: slabiop.h:80
an unknown Alternate Settings
Definition: slabiop.h:89
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...
SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS
Definition: slabiop.h:85
SILABS_STATUS IOP_SetCurrentAlternateSettingIOP(const HANDLE hHandle)
Set the current Alternate Setting on the device to IOP.
DEVICE_I2C_STATUS
Definition: slabiop.h:96
no error
Definition: silabs_defs.h:262
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.
SILABS_STATUS IOP_SetCurrentAlternateSettingIDLE(const HANDLE hHandle)
Set the current Alternate Setting on the device to IDLE.
Serial State.
Definition: slabiop.h:150
uint16_t PinOutMode
Bitmask: 0 = Open-Drain, 1 = Push-Pull.
Definition: slabiop.h:126
SILABS_STATUS IOP_SetCurrentAlternateSettingUART(const HANDLE hHandle)
Set the current Alternate Setting on the device to UART.
uint8_t PortNumber
The target digital port.
Definition: slabiop.h:123
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.
uint16_t OptionID
Customer specified value read from the configuration.
Definition: slabiop.h:115
uint32_t TimeStamp
32-bit Timestamp. 1 msec resolution.
Definition: slabiop.h:144
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.
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 dev...
uint16_t PinDirection
Bitmask: 0 = Input, 1 = Output.
Definition: slabiop.h:125
Digital Port Value.
Definition: slabiop.h:132
Analog Pin Value.
Definition: slabiop.h:141
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.
SILABS_STATUS IOP_Open(const uint32_t DeviceIndex, PHANDLE pHandle)
Opens a handle to the device.
uint8_t PortNumber
The target digital port.
Definition: slabiop.h:133
Accessory Information.
Definition: slabiop.h:113
I/O Protocol. Has one Bulk IN and one Bulk OUT endpoint for transporting IOP messages.
Definition: slabiop.h:88
an otherwise unclassified error occurred
Definition: silabs_defs.h:280
Parameter error (read or write count out of range).
Definition: slabiop.h:101
uint16_t PinMask
Bitmask indicates which pins changed or were queried by the iop_GetDigitalPort message.
Definition: slabiop.h:134
I2C transfer completed without errors.
Definition: slabiop.h:97
Port Configuration.
Definition: slabiop.h:122
UART. Has one Bulk IN and one Bulk OUT endpoint for transporting UART data.
Definition: slabiop.h:87
uint16_t PortValue
Bitfield returns current digital pin values (all pins are returned).
Definition: slabiop.h:135
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.
uint16_t PartID
Encoded part number of the chip (0x1400 for CP2615 Rev 1.0).
Definition: slabiop.h:114
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.
uint16_t PinFunction
Bitmask: 0 = Alternate, 1 = GPIO.
Definition: slabiop.h:124
SILABS_STATUS IOP_OpenByDevicePath(const char *pDevicePath, PHANDLE pHandle)
Opens a handle to the device.
SILABS_STATUS IOP_GetCurrentAlternateSetting(const HANDLE hHandle, SILABS_IOP_INTERFACE_ALTERNATE_SETTINGS *pAlternateSettingNumber)
Returns an indication of the current Alternate Setting in use.
uint16_t PinValue
Value read from the analog pin. (10-bit right-justified, Vdd fullscale for CP2615) ...
Definition: slabiop.h:143
SILABS_STATUS IOP_GetDevicePathString(const uint32_t DeviceIndex, char *pDevicePathString, const size_t DevicePathStringLenInBytes, size_t *pLenInBytes)
return the device instance's DevicePath string
SILABS_STATUS IOP_Write(const HANDLE hHandle, uint8_t *pBuffer, const size_t BufferLenInBytes, size_t *pBytesWritten, LPOVERLAPPED o=NULL)
Write buffer to device.
SILABS_STATUS
Definition: silabs_defs.h:261
I2C transfer timed out (slave did not respond).
Definition: slabiop.h:100
#define SLABIOPLIB_API
Silabs IOP lib API.
Definition: slabiop.h:79
SILABS_STATUS IOP_Close(const HANDLE hHandle)
Closes an open handle to the device.
I2C bus error (NAK received).
Definition: slabiop.h:98
SILABS_STATUS IOP_GetAccessoryInfo(const HANDLE hHandle, SILABS_IOP_ACCESSORY_INFO *pAccessoryInfo)
Returns accessory identification information of the device.
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 ...
Writing to configuration memory failed because the configuration is locked.
Definition: slabiop.h:102
I2C bus was busy.
Definition: slabiop.h:99