This source file includes following definitions.
- usb_cdc_header_descriptor_t
- usb_cdc_cm_descriptor_t
- usb_cdc_acm_descriptor_t
- usb_cdc_union_descriptor_t
- usb_cdc_ethernet_descriptor_t
- usb_cdc_abstract_state_t
- usb_cdc_line_state_t
- usb_cdc_notification_t
- usb_cdc_connection_speed_t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 #ifndef _USBCDC_H_
43 #define _USBCDC_H_
44
45 #define UDESCSUB_CDC_HEADER 0
46 #define UDESCSUB_CDC_CM 1
47 #define UDESCSUB_CDC_ACM 2
48 #define UDESCSUB_CDC_DLM 3
49 #define UDESCSUB_CDC_TRF 4
50 #define UDESCSUB_CDC_TCLSR 5
51 #define UDESCSUB_CDC_UNION 6
52 #define UDESCSUB_CDC_CS 7
53 #define UDESCSUB_CDC_TOM 8
54 #define UDESCSUB_CDC_USBT 9
55 #define UDESCSUB_CDC_NCT 10
56 #define UDESCSUB_CDC_PUF 11
57 #define UDESCSUB_CDC_EUF 12
58 #define UDESCSUB_CDC_MCMF 13
59 #define UDESCSUB_CDC_CCMF 14
60 #define UDESCSUB_CDC_ENF 15
61 #define UDESCSUB_CDC_ANF 16
62
63 typedef struct {
64 uByte bLength;
65 uByte bDescriptorType;
66 uByte bDescriptorSubtype;
67 uWord bcdCDC;
68 } __packed usb_cdc_header_descriptor_t;
69
70 typedef struct {
71 uByte bLength;
72 uByte bDescriptorType;
73 uByte bDescriptorSubtype;
74 uByte bmCapabilities;
75 #define USB_CDC_CM_DOES_CM 0x01
76 #define USB_CDC_CM_OVER_DATA 0x02
77 uByte bDataInterface;
78 } __packed usb_cdc_cm_descriptor_t;
79
80 typedef struct {
81 uByte bLength;
82 uByte bDescriptorType;
83 uByte bDescriptorSubtype;
84 uByte bmCapabilities;
85 #define USB_CDC_ACM_HAS_FEATURE 0x01
86 #define USB_CDC_ACM_HAS_LINE 0x02
87 #define USB_CDC_ACM_HAS_BREAK 0x04
88 #define USB_CDC_ACM_HAS_NETWORK_CONN 0x08
89 } __packed usb_cdc_acm_descriptor_t;
90
91 typedef struct {
92 uByte bLength;
93 uByte bDescriptorType;
94 uByte bDescriptorSubtype;
95 uByte bMasterInterface;
96 uByte bSlaveInterface[1];
97 } __packed usb_cdc_union_descriptor_t;
98
99 typedef struct {
100 uByte bLength;
101 uByte bDescriptorType;
102 uByte bDescriptorSubtype;
103 uByte iMacAddress;
104 uDWord bmEthernetStatistics;
105 uWord wMaxSegmentSize;
106 uWord wNumberMCFilters;
107 uByte bNumberPowerFilters;
108 } __packed usb_cdc_ethernet_descriptor_t;
109
110 #define UCDC_SEND_ENCAPSULATED_COMMAND 0x00
111 #define UCDC_GET_ENCAPSULATED_RESPONSE 0x01
112 #define UCDC_SET_COMM_FEATURE 0x02
113 #define UCDC_GET_COMM_FEATURE 0x03
114 #define UCDC_ABSTRACT_STATE 0x01
115 #define UCDC_COUNTRY_SETTING 0x02
116 #define UCDC_CLEAR_COMM_FEATURE 0x04
117 #define UCDC_SET_LINE_CODING 0x20
118 #define UCDC_GET_LINE_CODING 0x21
119 #define UCDC_SET_CONTROL_LINE_STATE 0x22
120 #define UCDC_LINE_DTR 0x0001
121 #define UCDC_LINE_RTS 0x0002
122 #define UCDC_SEND_BREAK 0x23
123 #define UCDC_BREAK_ON 0xffff
124 #define UCDC_BREAK_OFF 0x0000
125
126 typedef struct {
127 uWord wState;
128 #define UCDC_IDLE_SETTING 0x0001
129 #define UCDC_DATA_MULTIPLEXED 0x0002
130 } __packed usb_cdc_abstract_state_t;
131 #define UCDC_ABSTRACT_STATE_LENGTH 2
132
133 typedef struct {
134 uDWord dwDTERate;
135 uByte bCharFormat;
136 #define UCDC_STOP_BIT_1 0
137 #define UCDC_STOP_BIT_1_5 1
138 #define UCDC_STOP_BIT_2 2
139 uByte bParityType;
140 #define UCDC_PARITY_NONE 0
141 #define UCDC_PARITY_ODD 1
142 #define UCDC_PARITY_EVEN 2
143 #define UCDC_PARITY_MARK 3
144 #define UCDC_PARITY_SPACE 4
145 uByte bDataBits;
146 } __packed usb_cdc_line_state_t;
147 #define UCDC_LINE_STATE_LENGTH 7
148
149 typedef struct {
150 uByte bmRequestType;
151 #define UCDC_NOTIFICATION 0xa1
152 uByte bNotification;
153 #define UCDC_N_NETWORK_CONNECTION 0x00
154 #define UCDC_N_RESPONSE_AVAILABLE 0x01
155 #define UCDC_N_AUX_JACK_HOOK_STATE 0x08
156 #define UCDC_N_RING_DETECT 0x09
157 #define UCDC_N_SERIAL_STATE 0x20
158 #define UCDC_N_CALL_STATE_CHANGED 0x28
159 #define UCDC_N_LINE_STATE_CHANGED 0x29
160 #define UCDC_N_CONNECTION_SPEED_CHANGE 0x2a
161 uWord wValue;
162 uWord wIndex;
163 uWord wLength;
164 uByte data[16];
165 } __packed usb_cdc_notification_t;
166 #define UCDC_NOTIFICATION_LENGTH 8
167
168 typedef struct {
169 uDWord dwUSBitRate;
170 uDWord dwDSBitRate;
171 } __packed usb_cdc_connection_speed_t;
172 #define UCDC_CONNECTION_SPEED_LENGTH 8
173
174
175
176
177
178 #define UCDC_N_SERIAL_OVERRUN 0x40
179 #define UCDC_N_SERIAL_PARITY 0x20
180 #define UCDC_N_SERIAL_FRAMING 0x10
181 #define UCDC_N_SERIAL_RI 0x08
182 #define UCDC_N_SERIAL_BREAK 0x04
183 #define UCDC_N_SERIAL_DSR 0x02
184 #define UCDC_N_SERIAL_DCD 0x01
185
186 #endif