6 #ifndef HOST_LIB_SLABHIDSMBUS_INCLUDE_SLABCP2112_H_INCLUDED_QU4N7WC20W 7 #define HOST_LIB_SLABHIDSMBUS_INCLUDE_SLABCP2112_H_INCLUDED_QU4N7WC20W 17 #include "silabs_defs.h" 18 #include "silabs_sal.h" 30 #if defined(HID_TO_SMBUS_EXPORTS) 31 #define HID_TO_SMBUS_API 33 #define HID_TO_SMBUS_API __declspec(dllimport) 34 #pragma comment(lib, "SLABHIDtoSMBus.lib") 35 #endif // defined(HID_TO_SMBUS_EXPORTS) 37 #define HID_TO_SMBUS_API 48 typedef enum _HID_SMBUS_STATUS {
72 #else // defined(NOT_YET) 80 #define HID_SMBUS_SUCCESS SILABS_STATUS_SUCCESS 81 #define HID_SMBUS_DEVICE_NOT_FOUND 0x01 82 #define HID_SMBUS_INVALID_HANDLE 0x02 83 #define HID_SMBUS_INVALID_DEVICE_OBJECT 0x03 84 #define HID_SMBUS_INVALID_PARAMETER 0x04 85 #define HID_SMBUS_INVALID_REQUEST_LENGTH 0x05 87 #define HID_SMBUS_DEVICE_ALREADY_OPENED SILABS_STATUS_DEVICE_ALREADY_OPENED 89 #define HID_SMBUS_READ_ERROR 0x10 90 #define HID_SMBUS_WRITE_ERROR 0x11 91 #define HID_SMBUS_READ_TIMED_OUT 0x12 92 #define HID_SMBUS_WRITE_TIMED_OUT 0x13 93 #define HID_SMBUS_DEVICE_IO_FAILED 0x14 94 #define HID_SMBUS_DEVICE_ACCESS_ERROR 0x15 95 #define HID_SMBUS_DEVICE_NOT_SUPPORTED 0x16 97 #define HID_SMBUS_UNKNOWN_ERROR SILABS_STATUS_UNKNOWN_ERROR 98 #endif // defined(NOT_YET) 106 #define HID_SMBUS_S0_IDLE 0x00 107 #define HID_SMBUS_S0_BUSY 0x01 108 #define HID_SMBUS_S0_COMPLETE 0x02 109 #define HID_SMBUS_S0_ERROR 0x03 119 #define HID_SMBUS_S1_BUSY_ADDRESS_ACKED 0x00 120 #define HID_SMBUS_S1_BUSY_ADDRESS_NACKED 0x01 121 #define HID_SMBUS_S1_BUSY_READING 0x02 122 #define HID_SMBUS_S1_BUSY_WRITING 0x03 128 #define HID_SMBUS_S1_ERROR_TIMEOUT_NACK 0x00 129 #define HID_SMBUS_S1_ERROR_TIMEOUT_BUS_NOT_FREE 0x01 130 #define HID_SMBUS_S1_ERROR_ARB_LOST 0x02 131 #define HID_SMBUS_S1_ERROR_READ_INCOMPLETE 0x03 132 #define HID_SMBUS_S1_ERROR_WRITE_INCOMPLETE 0x04 133 #define HID_SMBUS_S1_ERROR_SUCCESS_AFTER_RETRY 0x05 142 typedef enum _HID_SMBUS_GETSTRING {
153 _Success_(
return == TRUE)
157 #define HID_SMBUS_DEVICE_STRLEN 260 170 #define HID_SMBUS_MIN_BIT_RATE 1 171 #define HID_SMBUS_MIN_TIMEOUT 0 172 #define HID_SMBUS_MAX_TIMEOUT 1000 173 #define HID_SMBUS_MAX_RETRIES 1000 174 #define HID_SMBUS_MIN_ADDRESS 0x02 175 #define HID_SMBUS_MAX_ADDRESS 0xFE 181 #define HID_SMBUS_MIN_READ_REQUEST_SIZE 1 182 #define HID_SMBUS_MAX_READ_REQUEST_SIZE 512 183 #define HID_SMBUS_MIN_TARGET_ADDRESS_SIZE 1 184 #define HID_SMBUS_MAX_TARGET_ADDRESS_SIZE 16 185 #define HID_SMBUS_MAX_READ_RESPONSE_SIZE 61 186 #define HID_SMBUS_MIN_WRITE_REQUEST_SIZE 1 187 #define HID_SMBUS_MAX_WRITE_REQUEST_SIZE 61 197 #define HID_SMBUS_DIRECTION_INPUT 0 198 #define HID_SMBUS_DIRECTION_OUTPUT 1 204 #define HID_SMBUS_MODE_OPEN_DRAIN 0 205 #define HID_SMBUS_MODE_PUSH_PULL 1 211 #define HID_SMBUS_MASK_FUNCTION_GPIO_7_CLK 0x01 212 #define HID_SMBUS_MASK_FUNCTION_GPIO_0_TXT 0x02 213 #define HID_SMBUS_MASK_FUNCTION_GPIO_1_RXT 0x04 219 #define HID_SMBUS_GPIO_FUNCTION 0 220 #define HID_SMBUS_SPECIAL_FUNCTION 1 226 #define HID_SMBUS_MASK_GPIO_0 0x01 227 #define HID_SMBUS_MASK_GPIO_1 0x02 228 #define HID_SMBUS_MASK_GPIO_2 0x04 229 #define HID_SMBUS_MASK_GPIO_3 0x08 230 #define HID_SMBUS_MASK_GPIO_4 0x10 231 #define HID_SMBUS_MASK_GPIO_5 0x20 232 #define HID_SMBUS_MASK_GPIO_6 0x40 233 #define HID_SMBUS_MASK_GPIO_7 0x80 242 #define HID_SMBUS_PART_CP2112 CP210x_PARTNUM_CP2112 250 typedef enum _HID_SMBUS_LOCKBITS {
263 _Success_(
return == TRUE)
264 __inline
static bool IsValidHID_SMBUS_HID_SMBUS_LOCKBITS(_In_
const HID_SMBUS_LOCKBITS _s)
275 #define HID_SMBUS_LOCK_UNLOCKED 1 276 #define HID_SMBUS_LOCK_LOCKED 0 280 #define HID_SMBUS_BUS_POWER_MAX 0xFA 285 #define HID_SMBUS_BUS_POWER 0x00 286 #define HID_SMBUS_SELF_POWER_VREG_DIS 0x01 287 #define HID_SMBUS_SELF_POWER_VREG_EN 0x02 293 #define HID_SMBUS_SET_VID 0x01 294 #define HID_SMBUS_SET_PID 0x02 295 #define HID_SMBUS_SET_POWER 0x04 296 #define HID_SMBUS_SET_POWER_MODE 0x08 297 #define HID_SMBUS_SET_RELEASE_VERSION 0x10 303 #define HID_SMBUS_SET_IGNORE 0 304 #define HID_SMBUS_SET_PROGRAM 1 310 #define HID_SMBUS_CP2112_MFG_STRLEN 30 311 #define HID_SMBUS_CP2112_PRODUCT_STRLEN 30 312 #define HID_SMBUS_CP2112_SERIAL_STRLEN 30 313 typedef char HID_SMBUS_CP2112_MFG_STR[HID_SMBUS_CP2112_MFG_STRLEN]; 337 #endif // __cplusplus 352 HidSmbus_GetNumDevices(_Out_writes_bytes_(
sizeof(DWORD)) _Pre_defensive_ DWORD* lpdwNumDevices, _In_ _Pre_defensive_
const WORD vid, _In_ _Pre_defensive_
const WORD pid);
384 HidSmbus_GetString(_In_ _Pre_defensive_
const DWORD deviceNum, _In_ _Pre_defensive_
const WORD vid, _In_ _Pre_defensive_
const WORD pid, _Out_ _Pre_defensive_
char* deviceString, _In_ _Pre_defensive_
const HID_SMBUS_GETSTRING options);
435 HidSmbus_GetIndexedString(_In_ _Pre_defensive_
const DWORD deviceNum, _In_ _Pre_defensive_
const WORD vid, _In_ _Pre_defensive_
const WORD pid, _In_ _Pre_defensive_
const DWORD stringIndex,
char* deviceString);
482 HidSmbus_GetAttributes(_In_ _Pre_defensive_
const DWORD deviceNum, _In_ _Pre_defensive_
const WORD vid, _In_ _Pre_defensive_
const WORD pid, _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* deviceVid, _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* devicePid, _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* deviceReleaseNumber);
503 HidSmbus_GetOpenedAttributes(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* deviceVid, _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* devicePid, _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* deviceReleaseNumber);
531 HidSmbus_Open(_Out_writes_bytes_(
sizeof(HID_SMBUS_DEVICE*)) _Pre_defensive_ HID_SMBUS_DEVICE* pdevice, _In_ _Pre_defensive_
const DWORD deviceNum, _In_ _Pre_defensive_
const WORD vid, _In_ _Pre_defensive_
const WORD pid);
549 HidSmbus_Close(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device);
565 HidSmbus_IsOpened(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _Out_writes_bytes_(
sizeof(BOOL)) _Pre_defensive_ BOOL* bIsOpened);
592 HidSmbus_ReadRequest(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _In_range_(0x02,0xFE) _Pre_defensive_
const BYTE slaveAddress, _In_range_(1, 512) _Pre_defensive_
const WORD numBytesToRead);
623 HidSmbus_AddressReadRequest(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _In_range_(0x02, 0xFE) _Pre_defensive_
const BYTE slaveAddress, _In_range_(1, 512) _Pre_defensive_
const WORD numBytesToRead, _In_range_(1, 16) _Pre_defensive_
const BYTE targetAddressSize,
BYTE targetAddress[16]);
649 HidSmbus_ForceReadResponse(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _In_range_(1, 512) _Pre_defensive_
const WORD numBytesToRead);
678 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
680 _Out_writes_bytes_(
sizeof(bufferSize)) _Pre_defensive_
BYTE* buffer,
681 _In_ _Pre_defensive_
const BYTE bufferSize,
682 _Out_writes_bytes_(
sizeof(
BYTE)) _Pre_defensive_
BYTE* numBytesRead
712 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
713 _In_range_(0x02, 0xFE) _Pre_defensive_
const BYTE slaveAddress,
714 _In_reads_bytes_(numBytesToWrite) _Pre_defensive_
BYTE* buffer,
715 _In_range_(1, 61) _Pre_defensive_
const BYTE numBytesToWrite
763 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
766 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* numRetries,
767 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* bytesRead
826 HidSmbus_SetTimeouts(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _In_ _Pre_defensive_
const DWORD responseTimeout);
847 HidSmbus_GetTimeouts(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _Out_writes_bytes_(
sizeof(DWORD)) _Pre_defensive_ DWORD* responseTimeout);
888 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
889 _In_ _Pre_defensive_
const DWORD bitRate,
891 _In_ _Pre_defensive_
const BOOL autoReadRespond,
894 _In_ _Pre_defensive_
const BOOL sclLowTimeout,
937 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
938 _Out_writes_bytes_(
sizeof(DWORD)) _Pre_defensive_ DWORD* bitRate,
939 _Out_writes_bytes_(
sizeof(
BYTE)) _Pre_defensive_
BYTE* address,
940 _Out_writes_bytes_(
sizeof(BOOL)) _Pre_defensive_ BOOL* autoReadRespond,
941 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* writeTimeout,
942 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* readTimeout,
943 _Out_writes_bytes_(
sizeof(BOOL)) _Pre_defensive_ BOOL* sclLowtimeout,
944 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* transferRetries
965 HidSmbus_Reset(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device);
988 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
989 _In_ _Pre_defensive_
const BYTE direction,
990 _In_ _Pre_defensive_
const BYTE mode,
991 _In_ _Pre_defensive_
const BYTE function,
992 _In_ _Pre_defensive_
const BYTE clkDiv
1016 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1017 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* direction,
1018 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* mode,
1019 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE*
function,
1020 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* clkDiv
1042 HidSmbus_ReadLatch(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* latchValue);
1063 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1064 _In_ _Pre_defensive_
const BYTE latchValue,
1065 _In_ _Pre_defensive_
const BYTE latchMask
1084 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1085 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* partNumber,
1086 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* version
1102 HidSmbus_GetLibraryVersion(_Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* major, _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* minor, _Out_writes_bytes_(
sizeof(BOOL)) _Pre_defensive_ BOOL* bIsRelease);
1115 HidSmbus_GetHidLibraryVersion(_Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* major, _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* minor, _Out_writes_bytes_(
sizeof(BOOL)) _Pre_defensive_ BOOL* bIsRelease);
1160 HidSmbus_SetLock(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _In_ _Pre_defensive_
const BYTE lock);
1177 HidSmbus_GetLock(_In_ _Pre_defensive_
const HID_SMBUS_DEVICE device, _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* lock);
1204 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1205 _In_ _Pre_defensive_
const WORD vid,
1206 _In_ _Pre_defensive_
const WORD pid,
1208 _In_ _Pre_defensive_
const BYTE powerMode,
1209 _In_ _Pre_defensive_
const WORD releaseVersion,
1210 _In_ _Pre_defensive_
const BYTE mask
1234 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1235 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* vid,
1236 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* pid,
1237 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* power,
1238 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* powerMode,
1239 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* releaseVersion
1260 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1261 _In_reads_bytes_(strlen) _Pre_defensive_
char* manufacturingString,
1283 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1284 char* manufacturingString,
1285 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* strlen
1306 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1307 _In_reads_bytes_(strlen) _Pre_defensive_
char* productString,
1329 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1330 char* productString,
1331 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* strlen
1352 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1353 _In_reads_bytes_(strlen) _Pre_defensive_
char* serialString,
1375 _In_ _Pre_defensive_
const HID_SMBUS_DEVICE device,
1377 _Out_writes_bytes_(
sizeof(BYTE)) _Pre_defensive_ BYTE* strlen
1382 #endif // __cplusplus 1386 #endif // HOST_LIB_SLABHIDSMBUS_INCLUDE_SLABCP2112_H_INCLUDED_QU4N7WC20W Vendor ID string.
Definition: SLABCP2112.h:143
#define HID_SMBUS_DEVICE_NOT_SUPPORTED
the current device does not support the corresponding action
Definition: SLABCP2112.h:95
Product String.
Definition: SLABCP2112.h:257
#define HID_SMBUS_DEVICE_NOT_FOUND
the specified device was not found
Definition: SLABCP2112.h:81
#define HID_SMBUS_INVALID_HANDLE
an handle parameter was not valid
Definition: SLABCP2112.h:82
#define HID_SMBUS_BUS_POWER_MAX
maximum power of 500mA, represented as a milliamps/2, I.e. 250 IFF bus-powered
Definition: SLABCP2112.h:280
Serial Number string.
Definition: SLABCP2112.h:146
#define HID_SMBUS_DEVICE_IO_FAILED
host was unable to get or set a feature report.
Definition: SLABCP2112.h:93
#define HID_SMBUS_MIN_TIMEOUT
HID SMBus min timeout.
Definition: SLABCP2112.h:171
#define HID_SMBUS_DEVICE_ACCESS_ERROR
the device or device property could not be accessed.Either the device is not opened, already opened when trying to open, or an error occurred when trying to get HID information.
Definition: SLABCP2112.h:94
HID_SMBUS_STATUS HidSmbus_SetLock(const HID_SMBUS_DEVICE device, const BYTE lock)
permanently locks/disables device customization.
HID_SMBUS_STATUS HidSmbus_GetTransferStatusResponse(const HID_SMBUS_DEVICE device, HID_SMBUS_S0 *status, HID_SMBUS_S1 *detailedStatus, WORD *numRetries, WORD *bytesRead)
returns the status of the current read or write transfer.
Product string.
Definition: SLABCP2112.h:148
no error
Definition: silabs_defs.h:262
HID_SMBUS_STATUS HidSmbus_GetOpenedAttributes(const HID_SMBUS_DEVICE device, WORD *deviceVid, WORD *devicePid, WORD *deviceReleaseNumber)
This function returns the device vendor ID, product ID, and device release number for the opened devi...
HID_SMBUS_STATUS HidSmbus_ReadRequest(const HID_SMBUS_DEVICE device, const BYTE slaveAddress, const WORD numBytesToRead)
intiates a read transfer to the specified slave device address.
HID_SMBUS_STATUS HidSmbus_GetHidGuid(void *pHIDGuid)
Return the GUID for HIDClass devices ("return the HID GUID") (Windows only)
#define HID_SMBUS_SUCCESS
Success.
Definition: SLABCP2112.h:80
#define HID_SMBUS_CP2112_SERIAL_STRLEN
HID SMBus CP2112 serial string length.
Definition: SLABCP2112.h:312
#define HID_SMBUS_WRITE_ERROR
the write was not successful.
Definition: SLABCP2112.h:90
HID_SMBUS_STATUS HidSmbus_Open(HID_SMBUS_DEVICE *pdevice, const DWORD deviceNum, const WORD vid, const WORD pid)
Opens a device using a device number between 0 and HidSmbus_GetNumDevices() - 1, enables the UART...
HID_SMBUS_STATUS HidSmbus_WriteLatch(const HID_SMBUS_DEVICE device, const BYTE latchValue, const BYTE latchMask)
sets the current GPIO latch value for the specified bits.
HID_SMBUS_STATUS HidSmbus_WriteRequest(const HID_SMBUS_DEVICE device, const BYTE slaveAddress, BYTE *buffer, const BYTE numBytesToWrite)
writes the specified number of bytes from the supplied buffer to the specified slave device and retur...
HID_SMBUS_STATUS HidSmbus_GetLibraryVersion(BYTE *major, BYTE *minor, BOOL *bIsRelease)
Reads and returns the HID USB-to-SMBus Interface Library version.
HID_SMBUS_GETSTRING
Definition: SLABCP2112.h:142
#define HID_SMBUS_READ_ERROR
the read was not successful and did not time out.
Definition: SLABCP2112.h:89
#define HID_SMBUS_INVALID_REQUEST_LENGTH
the specified number of bytes to read or write is invalid.
Definition: SLABCP2112.h:85
int HID_SMBUS_STATUS
HID SMBus status.
Definition: SLABCP2112.h:75
#define HID_SMBUS_MAX_ADDRESS
HID SMBus max address.
Definition: SLABCP2112.h:175
HID_SMBUS_STATUS HidSmbus_SetTimeouts(const HID_SMBUS_DEVICE device, const DWORD responseTimeout)
Sets the response timeouts.
#define HID_SMBUS_INVALID_PARAMETER
a parameter was not valid
Definition: SLABCP2112.h:84
VID.
Definition: SLABCP2112.h:251
HID_SMBUS_STATUS HidSmbus_GetGpioConfig(const HID_SMBUS_DEVICE device, BYTE *direction, BYTE *mode, BYTE *function, BYTE *clkDiv)
returns the GPIO pin's directions and modes.
HID_SMBUS_STATUS HidSmbus_SetGpioConfig(const HID_SMBUS_DEVICE device, const BYTE direction, const BYTE mode, const BYTE function, const BYTE clkDiv)
configures the GPIO pin's directions and modes.
Serial String.
Definition: SLABCP2112.h:258
enum _HID_SMBUS_GETSTRING * PHID_SMBUS_GETSTRING
Product String Types pointer.
#define HID_SMBUS_READ_TIMED_OUT
a read failed to return the number of bytes requested before the read timeout elapsed.
Definition: SLABCP2112.h:91
Manufacturing String.
Definition: SLABCP2112.h:256
Product ID string.
Definition: SLABCP2112.h:144
char HID_SMBUS_CP2112_PRODUCT_STR[30]
HID_SMBUS_PRODUCT_STR.
Definition: SLABCP2112.h:319
HID_SMBUS_STATUS HidSmbus_GetReadResponse(const HID_SMBUS_DEVICE device, HID_SMBUS_S0 *status, BYTE *buffer, const BYTE bufferSize, BYTE *numBytesRead)
returns the read response to a read request. Read and write timeouts as well as transfer retries can ...
HID_SMBUS_STATUS HidSmbus_Close(const HID_SMBUS_DEVICE device)
Closes an opened device using the device object pointer provided by HidUart_Open().
#define HID_SMBUS_UNKNOWN_ERROR
This value should never be returned.
Definition: SLABCP2112.h:97
#define HID_SMBUS_DEVICE_ALREADY_OPENED
the specified device is already (exclusively) opened
Definition: SLABCP2112.h:87
HID_SMBUS_STATUS HidSmbus_SetSerialString(const HID_SMBUS_DEVICE device, char *serialString, const BYTE strlen)
allows one-time customization of the USB serial string.
HID_SMBUS_STATUS HidSmbus_GetTimeouts(const HID_SMBUS_DEVICE device, DWORD *responseTimeout)
returns the current response timeouts specified in milliseconds.
void * HID_SMBUS_DEVICE
HID_SMBUS_DEVICE.
Definition: SLABCP2112.h:329
char HID_SMBUS_CP2112_SERIAL_STR[30]
HID_SMBUS_SERIAL_STR.
Definition: SLABCP2112.h:322
unsigned char BYTE
Byte definition.
Definition: silabs_defs.h:41
char HID_SMBUS_DEVICE_STR[260]
HID_SMBUS_DEVICE_STR.
Definition: SLABCP2112.h:161
HID_SMBUS_STATUS HidSmbus_GetUsbConfig(const HID_SMBUS_DEVICE device, WORD *vid, WORD *pid, BYTE *power, BYTE *powerMode, WORD *releaseVersion)
retrieves USB configuration, which includes vendor ID, product ID, power, power mode, release version, and flush buffers settings.
HID_SMBUS_STATUS HidSmbus_GetString(const DWORD deviceNum, const WORD vid, const WORD pid, char *deviceString, const HID_SMBUS_GETSTRING options)
This function returns a null-terminated vendor ID string, product ID string, serial number string...
an otherwise unclassified error occurred
Definition: silabs_defs.h:280
Path string.
Definition: SLABCP2112.h:145
Manufacturer string.
Definition: SLABCP2112.h:147
Power.
Definition: SLABCP2112.h:253
#define HID_SMBUS_MAX_RETRIES
HID SMBus max retries.
Definition: SLABCP2112.h:173
HID_SMBUS_STATUS HidSmbus_SetManufacturingString(const HID_SMBUS_DEVICE device, char *manufacturingString, const BYTE strlen)
Allows one-time customization of the USB manufacturing string.
BYTE HID_SMBUS_S1
HID_SMBUS_TRANSFER_S1.
Definition: SLABCP2112.h:114
HID_SMBUS_STATUS HidSmbus_SetProductString(const HID_SMBUS_DEVICE device, char *productString, const BYTE strlen)
allows one-time customization of the USB product string.
HID_SMBUS_STATUS HidSmbus_GetPartNumber(const HID_SMBUS_DEVICE device, BYTE *partNumber, BYTE *version)
retrieves the part number and version of the CP2112 device.
HID_SMBUS_STATUS HidSmbus_GetAttributes(const DWORD deviceNum, const WORD vid, const WORD pid, WORD *deviceVid, WORD *devicePid, WORD *deviceReleaseNumber)
This function returns the device vendor ID, product ID, and device release number for the device spec...
HID_SMBUS_STATUS HidSmbus_CancelIo(const HID_SMBUS_DEVICE device)
This function cancels any pending HID reads and writes (Windows Only).
Power Mode.
Definition: SLABCP2112.h:254
HID_SMBUS_STATUS HidSmbus_ForceReadResponse(const HID_SMBUS_DEVICE device, const WORD numBytesToRead)
cause the device to send a read response to the host after a read transfer has been issued...
HID_SMBUS_LOCKBITS
Definition: SLABCP2112.h:250
HID_SMBUS_STATUS HidSmbus_GetSmbusConfig(const HID_SMBUS_DEVICE device, DWORD *bitRate, BYTE *address, BOOL *autoReadRespond, WORD *writeTimeout, WORD *readTimeout, BOOL *sclLowtimeout, WORD *transferRetries)
gets the SMBus bit rate, address, and transfer settings such as timeouts and retries.
#define HID_SMBUS_MAX_TIMEOUT
HID SMBus max timeout.
Definition: SLABCP2112.h:172
PID.
Definition: SLABCP2112.h:252
Release Version.
Definition: SLABCP2112.h:255
HID_SMBUS_STATUS HidSmbus_GetProductString(const HID_SMBUS_DEVICE device, char *productString, BYTE *strlen)
retrieves the USB product string.
#define HID_SMBUS_CP2112_MFG_STRLEN
HID SMBus CP2112 manufacturing string length.
Definition: SLABCP2112.h:310
enum _HID_SMBUS_LOCKBITS * PHID_SMBUS_LOCKBITS
User-Customizable Field Lock Bitmasks pointer.
HID_SMBUS_STATUS HidSmbus_GetNumDevices(DWORD *lpdwNumDevices, const WORD vid, const WORD pid)
Determines the number of devices connected to the system with matching VID/PID.
HID_SMBUS_STATUS HidSmbus_CancelTransfer(const HID_SMBUS_DEVICE device)
cancels the current read or write transfer.
#define HID_SMBUS_DEVICE_STRLEN
HID SMBus device string length.
Definition: SLABCP2112.h:157
HID_SMBUS_STATUS HidSmbus_ReadLatch(const HID_SMBUS_DEVICE device, BYTE *latchValue)
returns the current GPIO latch value.
#define HID_SMBUS_MIN_ADDRESS
HID SMBus min address.
Definition: SLABCP2112.h:174
HID_SMBUS_STATUS HidSmbus_AddressReadRequest(const HID_SMBUS_DEVICE device, const BYTE slaveAddress, const WORD numBytesToRead, const BYTE targetAddressSize, BYTE targetAddress[16])
intiates a read transfer to the specified slave device address and specifies the address to read from...
#define HID_SMBUS_WRITE_TIMED_OUT
a write failed to complete sending the number of bytes requested before the write timeout elapsed...
Definition: SLABCP2112.h:92
HID_SMBUS_STATUS HidSmbus_TransferStatusRequest(const HID_SMBUS_DEVICE device)
requests the status of the current read or write transfer.
HID_SMBUS_STATUS HidSmbus_Reset(const HID_SMBUS_DEVICE device)
initiates a full device reset. All configuration settings will be reset to their default values after...
#define HID_SMBUS_INVALID_DEVICE_OBJECT
the device object pointer does not match the address of a valid HID - to - UART device ...
Definition: SLABCP2112.h:83
HID_SMBUS_STATUS HidSmbus_GetIndexedString(const DWORD deviceNum, const WORD vid, const WORD pid, const DWORD stringIndex, char *deviceString)
This function returns a null-terminated USB string descriptor for the device specified by an index pa...
HID_SMBUS_STATUS HidSmbus_GetOpenedIndexedString(const HID_SMBUS_DEVICE device, const DWORD stringIndex, char *deviceString)
This function returns a null-terminated USB string descriptor for the device specified by device...
HID_SMBUS_STATUS HidSmbus_SetSmbusConfig(const HID_SMBUS_DEVICE device, const DWORD bitRate, const BYTE address, const BOOL autoReadRespond, const WORD writeTimeout, const WORD readTimeout, const BOOL sclLowTimeout, const WORD transferRetries)
sets the SMBus bit rate, address, and transfer settings such as timeouts and retries.
#define WINAPI
Windows api definition.
Definition: SLABCP2112.h:38
HID_SMBUS_STATUS HidSmbus_GetLock(const HID_SMBUS_DEVICE device, BYTE *lock)
Get and return the device customization lock status.
HID_SMBUS_STATUS HidSmbus_GetHidLibraryVersion(BYTE *major, BYTE *minor, BOOL *bIsRelease)
Reads and returns the version of the HID Device Interface Library that is currently in use...
#define HID_TO_SMBUS_API
HID to smbus api definition.
Definition: SLABCP2112.h:37
BYTE HID_SMBUS_S0
HID_SMBUS_TRANSFER_S0.
Definition: SLABCP2112.h:102
HID_SMBUS_STATUS HidSmbus_GetManufacturingString(const HID_SMBUS_DEVICE device, char *manufacturingString, BYTE *strlen)
retrieves the USB manufacturing string.
HID_SMBUS_STATUS HidSmbus_IsOpened(const HID_SMBUS_DEVICE device, BOOL *bIsOpened)
Returns the device opened status.
HID_SMBUS_STATUS HidSmbus_SetUsbConfig(const HID_SMBUS_DEVICE device, const WORD vid, const WORD pid, const BYTE power, const BYTE powerMode, const WORD releaseVersion, const BYTE mask)
This function allows one-time customization of the USB configuration, which includes vendor ID...
#define HID_SMBUS_CP2112_PRODUCT_STRLEN
HID SMBus CP2112 product string length.
Definition: SLABCP2112.h:311
the specified device is already (exclusively) opened
Definition: silabs_defs.h:270
HID_SMBUS_STATUS HidSmbus_GetSerialString(const HID_SMBUS_DEVICE device, char *serialString, BYTE *strlen)
retrieves the USB product string.
HID_SMBUS_STATUS HidSmbus_GetOpenedString(const HID_SMBUS_DEVICE device, char *deviceString, const HID_SMBUS_GETSTRING options)
This function returns a null-terminated vendor ID string, product ID string, serial number string...