comparison cp2102/cp210x_defs.h @ 50:a5c4a82d01ab

cp2102-read-partno program written, compiles
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 11 Sep 2023 17:41:24 +0000
parents
children d4d3531d342a
comparison
equal deleted inserted replaced
49:9ca4f9fa415b 50:a5c4a82d01ab
1 /*
2 * Definitions for talking to CP2102 and perhaps other CP210x chips,
3 * taken from Python-based cp210x-program-1.0 tool from 2014,
4 * translated from Python to C.
5 */
6
7 #define CP210x_CONFIG 0xFF
8
9 #define REG_VENDOR_ID 0x3701
10 #define REG_PRODUCT_ID 0x3702
11 #define REG_PRODUCT_STRING 0x3703
12 #define REG_SERIAL_NUMBER 0x3704
13 #define REG_CFG_ATTRIBUTES 0x3705
14 #define REG_MAX_POWER 0x3706
15 #define REG_VERSION 0x3707
16 #define REG_UNKNOWN 0x3708
17 #define REG_EEPROM 0x3709
18 #define REG_LOCK_VALUE 0x370A
19 #define REG_PART_NUMBER 0x370B
20
21 #define SIZE_EEPROM 0x0400
22 #define SIZE_PRODUCT_STRING 255
23 #define SIZE_SERIAL_NUMBER 128
24 #define SIZE_BAUDRATES 32
25 #define SIZE_BAUDRATE_CFG 10
26 #define SIZE_BAUDRATE_TABLE (SIZE_BAUDRATES * SIZE_BAUDRATE_CFG)
27 #define SIZE_VENDOR_STRING 50
28
29 /* a little bit adapted from libftdi */
30
31 #define DEVICE_OUT_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT)
32 #define DEVICE_IN_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN)
33
34 #define USB_READ_TIMEOUT 5000
35 #define USB_WRITE_TIMEOUT 5000