13 #include "SLABHIDtoUART.h" 14 #include "CP2114_Common.h" 22 #define HID_UART_INVALID_CONFIG_NUMBER kInvalidConfigNumber 23 #define HID_UART_BOOT_INDEXES_DEPLETED kBootIndicesDepleted 24 #define HID_UART_REQUESTED_CONFIG_NOT_PRESENT kRequestedConfigNotPresent 25 #define HID_UART_CONFIG_INVALID kRequestedConfigInvalid 26 #define HID_UART_CONFIG_POINTERS_DEPLETED kConfigPointersDepleted 27 #define HID_UART_CONFIG_SPACE_DEPLETED kConfigSpaceDepleted 28 #define HID_UART_BOOT_INDEX_UNCHANGED kBootIndexUnchanged 29 #define HID_UART_CONFIG_UNCHANGED kConfigUnchanged 30 #define HID_UART_INVALID_CONFIG_SEQUENCE_IDENTIFIER kConfigInvalidConfigIdentifier 31 #define HID_UART_INVALID_CONFIG_SETTINGS kConfigSettingsInvalid 32 #define HID_UART_UNSUPPORTED_CONFIG_FORMAT kUnsupportedConfigFormat 36 #define HID_UART_INVALID_NUMBER_OF_CACHED_PARAMS kInvalidNumberOfCachedParams 37 #define HID_UART_UNEXPECTED_CACHE_DATA kUnexpectedCacheData 39 #define HID_UART_I2C_BUSY kI2cBusy 42 #define HID_UART_I2C_TIMEOUT kI2cTimeout 43 #define HID_UART_I2C_INVALID_TOKEN kI2cInvalidToken 44 #define HID_UART_I2C_INVALID_WRITE_LENGTH kI2cInvalidWriteLength 45 #define HID_UART_I2C_INVALID_CONFIG_LENGTH kI2cInvalidConfigLength 46 #define HID_UART_I2C_SCL_STUCK_LOW kI2cSclStuckLow 47 #define HID_UART_I2C_SDA_STUCK_LOW kI2cSdaStuckLow 57 #define CP2114_INDEX_GPIO_0 0 58 #define CP2114_INDEX_GPIO_1 1 59 #define CP2114_INDEX_GPIO_2 2 60 #define CP2114_INDEX_GPIO_3 3 61 #define CP2114_INDEX_GPIO_4 4 62 #define CP2114_INDEX_GPIO_5 5 63 #define CP2114_INDEX_GPIO_6 6 64 #define CP2114_INDEX_GPIO_7 7 65 #define CP2114_INDEX_GPIO_8 8 66 #define CP2114_INDEX_GPIO_9 9 67 #define CP2114_INDEX_TX 10 68 #define CP2114_INDEX_RX 11 69 #define CP2114_INDEX_SUSPEND 12 70 #define CP2114_INDEX_SUSPEND_BAR 13 71 // Size of the above array pointed to by pinConfig parameter in CP2114_SetPinConfig and CP2114_GetPinConfig 72 #define CP2114_PIN_CONFIG_SIZE 14 75 #define CP2114_MASK_GPIO_0 0x0001 79 #define CP2114_MASK_GPIO_1 0x0002 80 #define CP2114_MASK_GPIO_2 0x0004 81 #define CP2114_MASK_GPIO_3 0x0008 82 #define CP2114_MASK_GPIO_4 0x0010 83 #define CP2114_MASK_GPIO_5 0x0020 84 #define CP2114_MASK_GPIO_6 0x0040 85 #define CP2114_MASK_GPIO_7 0x0080 86 #define CP2114_MASK_GPIO_8 0x0100 87 #define CP2114_MASK_GPIO_9 0x0200 88 #define CP2114_MASK_TX 0x0400 89 #define CP2114_MASK_RX 0x0800 90 #define CP2114_MASK_SUSPEND 0x1000 91 #define CP2114_MASK_SUSPEND_BAR 0x2000 98 #define MAX_DAC_CONFIG_SIZE (2*512 - sizeof(CP2114_RAM_CONFIG_STRUCT)) 103 #define DAC_REGISTERS_PAYLOAD_MAX_LEN 60 124 BYTE RemConfig[ RAM_CONFIG_SIZE_B01];
125 BYTE DacConfig[ MAX_DAC_CONFIG_SIZE];
131 BYTE PemConfig[ RAM_CONFIG_SIZE_B02];
132 BYTE DacConfig[ MAX_DAC_CONFIG_SIZE];
152 #endif // __cplusplus 171 CP2114_GetVersions(_In_ _Pre_defensive_
HID_UART_DEVICE device, _Out_writes_bytes_(
sizeof(
BYTE)) _Pre_defensive_
BYTE* api_version, _Out_writes_bytes_(1)
BYTE* fw_version, _Out_writes_bytes_(1)
BYTE* config_version);
196 _In_ _Pre_defensive_
const BOOL useSuspendValues,
197 _In_ _Pre_defensive_
const WORD suspendValue,
198 _In_ _Pre_defensive_
const WORD suspendMode,
199 _In_ _Pre_defensive_
const BYTE clkDiv
225 _Out_writes_bytes_(
sizeof(BOOL)) _Pre_defensive_ BOOL* useSuspendValues,
226 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* suspendValue,
227 _Out_writes_bytes_(
sizeof(WORD)) _Pre_defensive_ WORD* suspendMode,
228 _Out_writes_bytes_(
sizeof(
BYTE)) _Pre_defensive_
BYTE* clkDiv
252 CP2114_GetDeviceStatus(
254 _Out_writes_bytes_(
sizeof(
BYTE)) _Pre_defensive_
BYTE *pCP2114Status
272 CP2114_GetDeviceCaps(
407 CP2114_SetDacRegisters(
409 _In_reads_bytes_(dacConfigBufferLengthInBytes) _Pre_defensive_
const BYTE* pDacConfigBuffer,
410 _In_ _Pre_defensive_
const BYTE dacConfigBufferLengthInBytes
438 CP2114_GetDacRegisters(
440 _In_ _Pre_defensive_
const BYTE dacStartAddress,
441 _In_ _Pre_defensive_
const BYTE dacRegistersToRead,
442 _Out_ _Pre_defensive_
BYTE* pDacConfigBuffer
463 _In_ _Pre_defensive_
const BYTE cp2114ConfigNumber,
464 _Out_writes_bytes_(
sizeof(
CP2114_OTP_CONFIG_GET)) _Pre_defensive_ PCP2114_OTP_CONFIG_GET pCP2114ConfigStruct
494 CP2114_CreateOtpConfig(
496 _In_ _Pre_defensive_ WORD configBufferLengthInBytes,
497 _In_reads_bytes_(configBufferLengthInBytes) _Pre_defensive_
BYTE* pConfigBuffer
515 CP2114_SetBootConfig(
517 _In_ _Pre_defensive_
const BYTE cp2114ConfigNumber
542 _In_ _Pre_defensive_
const UINT cp2114Address,
543 _Out_writes_bytes_(ReadLengthInBytes) _Pre_defensive_
BYTE* pReadBuffer,
544 _In_ _Pre_defensive_
const UINT ReadLengthInBytes
568 _In_ _Pre_defensive_ UINT cp2114Address,
569 _In_reads_bytes_(writeLengthInBytes) _Pre_defensive_
BYTE* pWriteBuffer,
570 _In_ _Pre_defensive_ UINT writeLengthInBytes
594 _In_ _Pre_defensive_
const BYTE slaveAddress,
595 _In_reads_bytes_(writeLength) _Pre_defensive_
const BYTE* pWriteBuffer,
596 _In_ _Pre_defensive_
const BYTE writeLengthInBytes
623 _In_ _Pre_defensive_
const BYTE slaveAddress,
624 _In_reads_bytes_(WriteLengthInBytes) _Pre_defensive_
const BYTE* pWriteBuffer,
625 _In_ _Pre_defensive_
const BYTE WriteLengthInBytes,
626 _Out_writes_bytes_(ReadLengthInBytes) _Pre_defensive_
BYTE* pReadBuffer,
627 _In_ _Pre_defensive_
const BYTE ReadLengthInBytes
632 #endif // __cplusplus 634 #endif // SLAB_CP2114_H CP2114_OTP_CONFIG OtpConfig
otp config
Definition: SLABCP2114.h:142
if config_version == CP2114_CONFIG_VERSION_B02
tbd
Definition: CP2114_Common.h:115
Definition: SLABCP2114.h:118
HID_UART_STATUS
Definition: SLABHIDtoUART.h:85
#define CP2114_PIN_CONFIG_SIZE
Config size, number of indexes.
Definition: SLABCP2114.h:72
if config_version == CP2114_CONFIG_VERSION_B01
This value should never be returned.
Definition: SLABHIDtoUART.h:104
Success.
Definition: SLABHIDtoUART.h:86
#define WINAPI
WINAPI.
Definition: CP210xManufacturingDLL.h:70
unsigned short U16
unsigned uint 16
Definition: SLABHIDtoUART.h:351
Definition: SLABCP2114.h:139
#define HID_TO_UART_API
HID to UART API.
Definition: SLABHIDtoUART.h:72
unsigned char BYTE
Byte definition.
Definition: silabs_defs.h:41
CP2114 Capabilities.
Definition: CP2114_Common.h:91
U16 Length
length
Definition: SLABCP2114.h:141
void * HID_UART_DEVICE
HID to UART device.
Definition: SLABHIDtoUART.h:345