1 #ifndef HOST_LIB_RUNTIME_INCLUDE_CP210XRUNTIMEDLL_H_INCLUDED_QU4N7WC20W 2 #define HOST_LIB_RUNTIME_INCLUDE_CP210XRUNTIMEDLL_H_INCLUDED_QU4N7WC20W 43 #include "silabs_defs.h" 44 #include "silabs_sal.h" 53 #ifdef CP210xRUNTIMEDLL_EXPORTS 54 #define CP210xRUNTIMEDLL_API 56 #if defined(SILABS_STATIC_LINK) 57 #define CP210xRUNTIMEDLL_API extern 58 #pragma comment (lib, "CP210xRuntime.static.lib") 59 #else // defined(SILABS_STATIC_LINK) 60 #define CP210xRUNTIMEDLL_API __declspec(dllimport) 61 #pragma comment (lib, "CP210xRuntime.lib") 62 #endif // defined(SILABS_STATIC_LINK) 67 #define CP210xRUNTIMEDLL_API 74 #define CP210x_CP2101_VERSION CP210x_PARTNUM_CP2101 75 #define CP210x_CP2102_VERSION CP210x_PARTNUM_CP2102 76 #define CP210x_CP2103_VERSION CP210x_PARTNUM_CP2103 77 #define CP210x_CP2104_VERSION CP210x_PARTNUM_CP2104 78 #define CP210x_CP2105_VERSION CP210x_PARTNUM_CP2105 79 #define CP210x_CP2108_VERSION CP210x_PARTNUM_CP2108 80 #define CP210x_CP2109_VERSION CP210x_PARTNUM_CP2109 81 #define CP210x_CP2102N_QFN28_VERSION CP210x_PARTNUM_CP2102N_QFN28 82 #define CP210x_CP2102N_QFN24_VERSION CP210x_PARTNUM_CP2102N_QFN24 83 #define CP210x_CP2102N_QFN20_VERSION CP210x_PARTNUM_CP2102N_QFN20 89 typedef enum _CP210x_STATUS {
102 #else // defined(NOT_YET) 103 #define CP210x_SUCCESS SILABS_STATUS_SUCCESS 106 #define CP210x_INVALID_HANDLE 0x01 107 #define CP210x_INVALID_PARAMETER 0x02 108 #define CP210x_DEVICE_IO_FAILED 0x03 109 #define CP210x_FUNCTION_NOT_SUPPORTED 0x04 110 #define CP210x_GLOBAL_DATA_ERROR 0x05 111 #define CP210x_FILE_ERROR 0x06 112 #define CP210x_COMMAND_FAILED 0x08 113 #define CP210x_INVALID_ACCESS_TYPE 0x09 114 #define CP210x_DEVICE_NOT_FOUND 0xFF 115 typedef int CP210x_STATUS; 116 #endif // defined(NOT_YET) 120 #define CP210x_MAX_PRODUCT_STRLEN 126 121 #define CP210x_MAX_SERIAL_STRLEN_S 126 122 #define CP210x_MAX_SETUP_STRING_SIZE 246 130 #define CP210x_GPIO_0 0x0001 131 #define CP210x_GPIO_1 0x0002 132 #define CP210x_GPIO_2 0x0004 133 #define CP210x_GPIO_3 0x0008 134 #define CP210x_GPIO_4 0x0010 135 #define CP210x_GPIO_5 0x0020 136 #define CP210x_GPIO_6 0x0040 137 #define CP210x_GPIO_7 0x0080 138 #define CP210x_GPIO_8 0x0100 139 #define CP210x_GPIO_9 0x0200 140 #define CP210x_GPIO_10 0x0400 141 #define CP210x_GPIO_11 0x0800 142 #define CP210x_GPIO_12 0x1000 143 #define CP210x_GPIO_13 0x2000 144 #define CP210x_GPIO_14 0x4000 145 #define CP210x_GPIO_15 0x8000 150 #endif // __cplusplus 163 _Out_writes_bytes_(
sizeof(uint32_t)) _Pre_defensive_ uint32_t *lpdwNumDevices
185 _In_ _Pre_defensive_
const uint32_t DeviceIndex,
186 _Out_writes_bytes_(
sizeof(HANDLE)) _Pre_defensive_ PHANDLE pcyHandle
200 _In_ _Pre_defensive_
const HANDLE cyHandle
224 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ LPWORD lpwLatch);
245 _In_ _Pre_defensive_
const WORD mask,
246 _In_ _Pre_defensive_
const WORD latch);
263 _Out_writes_bytes_(1) _Pre_defensive_ LPBYTE lpbPartNum);
289 _Out_writes_bytes_(*lpbProductStringLengthInBytes) _Pre_defensive_ LPVOID lpProductString,
290 _Out_writes_bytes_(1) _Pre_defensive_ LPBYTE lpbProductStringLengthInBytes,
291 _In_ _Pre_defensive_
const BOOL bConvertToASCII = TRUE
318 _Out_writes_bytes_(*lpbSerialNumberStringLengthInBytes) _Pre_defensive_ LPVOID lpSerialNumberString,
319 _Out_writes_bytes_(1) _Pre_defensive_ LPBYTE lpbSerialNumberStringLengthInBytes,
320 _In_ _Pre_defensive_
const BOOL bConvertToASCII = TRUE
349 _Out_writes_bytes_(*lpbInterfaceStringLengthInBytes) _Pre_defensive_ LPVOID lpInterfaceString,
350 _Out_writes_bytes_(1) _Pre_defensive_ LPBYTE lpbInterfaceStringLengthInBytes,
351 _In_ _Pre_defensive_
const BOOL bConvertToASCII);
371 _Out_writes_bytes_(2) _Pre_defensive_ uint16_t *pReceiverMaxTimeoutInMicroseconds);
391 _In_ _Pre_defensive_
const uint16_t ReceiverMaxTimeoutInMicroseconds);
395 #endif // __cplusplus 399 #endif // !HOST_LIB_RUNTIME_INCLUDE_CP210XRUNTIMEDLL_H_INCLUDED_QU4N7WC20W #define WINAPI
WINAPI defination.
Definition: CP210xRuntimeDLL.h:66
char CP210x_PRODUCT_STRING[126]
cp210x product string
Definition: CP210xRuntimeDLL.h:124
CP210x_STATUS CP210xRT_GetDeviceProductString(const HANDLE cyHandle, LPVOID lpProductString, LPBYTE lpbProductStringLengthInBytes, const BOOL bConvertToASCII=TRUE)
Reads and returns the Product string directly from the device.
#define CP210x_GLOBAL_DATA_ERROR
global data error
Definition: CP210xRuntimeDLL.h:110
CP210x_STATUS CP210xRT_GetDeviceSerialNumber(const HANDLE cyHandle, LPVOID lpSerialNumberString, LPBYTE lpbSerialNumberStringLengthInBytes, const BOOL bConvertToASCII=TRUE)
Reads and returns the Serial Number String directly from the device.
no error
Definition: silabs_defs.h:262
CP210x_STATUS CP210xRT_ReadLatch(const HANDLE cyHandle, LPWORD lpwLatch)
CP210x_STATUS CP210xRT_Close(const HANDLE cyHandle)
Closes an open handle to the device.
#define CP210x_SUCCESS
Success.
Definition: CP210xRuntimeDLL.h:105
#define CP210x_INVALID_PARAMETER
a parameter was not valid
Definition: CP210xRuntimeDLL.h:107
int CP210x_STATUS
CP210x_STATUS.
Definition: CP210xRuntimeDLL.h:115
CP210x_STATUS CP210xRT_GetReceiverMaxTimeout(const HANDLE cyHandle, uint16_t *pReceiverMaxTimeoutInMicroseconds)
Reads and returns the Receiver Max Timeout directly from the device.
char CP210x_SERIAL_STRING_S[126]
cp210x serial string
Definition: CP210xRuntimeDLL.h:125
CP210x_STATUS CP210xRT_GetDeviceInterfaceString(const HANDLE cyHandle, LPVOID lpInterfaceString, LPBYTE lpbInterfaceStringLengthInBytes, const BOOL bConvertToASCII)
Reads and returns the Interface String directly from the device.
#define CP210x_MAX_PRODUCT_STRLEN
Max Product string length.
Definition: CP210xRuntimeDLL.h:120
int CP210x_STATUS
CP210x_STATUS.
Definition: CP210xManufacturingDLL.h:131
CP210x_STATUS CP210xRT_WriteLatch(const HANDLE cyHandle, const WORD mask, const WORD latch)
Sets a new current GPIO port latch value for the device.
#define CP210x_INVALID_ACCESS_TYPE
invalid access type
Definition: CP210xRuntimeDLL.h:113
#define CP210x_DEVICE_IO_FAILED
device I/O failed
Definition: CP210xRuntimeDLL.h:108
CP210x_STATUS CP210xRT_GetNumDevices(uint32_t *lpdwNumDevices)
Determines the number of CP210x devices connected to the system.
CP210x_STATUS CP210xRT_SetReceiverMaxTimeout(const HANDLE cyHandle, const uint16_t ReceiverMaxTimeoutInMicroseconds)
Sets the Receiver Max Timeout directly to the device.
#define CP210x_INVALID_HANDLE
an handle parameter was not valid
Definition: CP210xRuntimeDLL.h:106
#define CP210x_FILE_ERROR
file error
Definition: CP210xRuntimeDLL.h:111
#define CP210x_DEVICE_NOT_FOUND
the specified device was not found
Definition: CP210xRuntimeDLL.h:114
#define CP210xRUNTIMEDLL_API
CP210xRUNTIMEDLL_API defination.
Definition: CP210xRuntimeDLL.h:67
CP210x_STATUS CP210xRT_GetPartNumber(const HANDLE cyHandle, LPBYTE lpbPartNum)
Reads and returns the Part Number from the device.
#define CP210x_COMMAND_FAILED
command failed
Definition: CP210xRuntimeDLL.h:112
CP210x_STATUS CP210xRT_Open(const uint32_t DeviceIndex, PHANDLE pcyHandle)
Opens a handle to the device.
#define CP210x_FUNCTION_NOT_SUPPORTED
the specified function is not supported
Definition: CP210xRuntimeDLL.h:109
#define CP210x_MAX_SERIAL_STRLEN_S
Max Serial Number string length.
Definition: CP210xRuntimeDLL.h:121