usb_protocol_cdc.h
Go to the documentation of this file.
1 
33 /*
34  * Support and FAQ: visit <a href="https://www.microchip.com/support/">Microchip Support</a>
35  */
36 #ifndef _USB_PROTOCOL_CDC_H_
37 #define _USB_PROTOCOL_CDC_H_
38 
39 #include "compiler.h"
40 
51 #define CDC_CLASS_DEVICE 0x02
52 #define CDC_CLASS_COMM 0x02
53 #define CDC_CLASS_DATA 0x0A
54 
55 
56 
58 #define CDC_SUBCLASS_DLCM 0x01
59 #define CDC_SUBCLASS_ACM 0x02
60 #define CDC_SUBCLASS_TCM 0x03
61 #define CDC_SUBCLASS_MCCM 0x04
62 #define CDC_SUBCLASS_CCM 0x05
63 #define CDC_SUBCLASS_ETH 0x06
64 #define CDC_SUBCLASS_ATM 0x07
65 
66 
67 
69 #define CDC_PROTOCOL_V25TER 0x01
70 
71 
72 
74 #define CDC_PROTOCOL_I430 0x30
75 #define CDC_PROTOCOL_HDLC 0x31
76 #define CDC_PROTOCOL_TRANS 0x32
77 #define CDC_PROTOCOL_Q921M 0x50
78 #define CDC_PROTOCOL_Q921 0x51
79 #define CDC_PROTOCOL_Q921TM 0x52
80 #define CDC_PROTOCOL_V42BIS 0x90
81 #define CDC_PROTOCOL_Q931 0x91
82 #define CDC_PROTOCOL_V120 0x92
83 #define CDC_PROTOCOL_CAPI20 0x93
84 #define CDC_PROTOCOL_HOST 0xFD
85 
89 #define CDC_PROTOCOL_PUFD 0xFE
90 
91 
93 
94 #define CDC_CS_INTERFACE 0x24
95 #define CDC_CS_ENDPOINT 0x25
96 
97 
98 
100 #define CDC_SCS_HEADER 0x00
101 #define CDC_SCS_CALL_MGMT 0x01
102 #define CDC_SCS_ACM 0x02
103 #define CDC_SCS_UNION 0x06
104 
105 
106 
108 #define USB_REQ_CDC_SEND_ENCAPSULATED_COMMAND 0x00
109 #define USB_REQ_CDC_GET_ENCAPSULATED_RESPONSE 0x01
110 #define USB_REQ_CDC_SET_COMM_FEATURE 0x02
111 #define USB_REQ_CDC_GET_COMM_FEATURE 0x03
112 #define USB_REQ_CDC_CLEAR_COMM_FEATURE 0x04
113 #define USB_REQ_CDC_SET_AUX_LINE_STATE 0x10
114 #define USB_REQ_CDC_SET_HOOK_STATE 0x11
115 #define USB_REQ_CDC_PULSE_SETUP 0x12
116 #define USB_REQ_CDC_SEND_PULSE 0x13
117 #define USB_REQ_CDC_SET_PULSE_TIME 0x14
118 #define USB_REQ_CDC_RING_AUX_JACK 0x15
119 #define USB_REQ_CDC_SET_LINE_CODING 0x20
120 #define USB_REQ_CDC_GET_LINE_CODING 0x21
121 #define USB_REQ_CDC_SET_CONTROL_LINE_STATE 0x22
122 #define USB_REQ_CDC_SEND_BREAK 0x23
123 #define USB_REQ_CDC_SET_RINGER_PARMS 0x30
124 #define USB_REQ_CDC_GET_RINGER_PARMS 0x31
125 #define USB_REQ_CDC_SET_OPERATION_PARMS 0x32
126 #define USB_REQ_CDC_GET_OPERATION_PARMS 0x33
127 #define USB_REQ_CDC_SET_LINE_PARMS 0x34
128 #define USB_REQ_CDC_GET_LINE_PARMS 0x35
129 #define USB_REQ_CDC_DIAL_DIGITS 0x36
130 #define USB_REQ_CDC_SET_UNIT_PARAMETER 0x37
131 #define USB_REQ_CDC_GET_UNIT_PARAMETER 0x38
132 #define USB_REQ_CDC_CLEAR_UNIT_PARAMETER 0x39
133 #define USB_REQ_CDC_GET_PROFILE 0x3A
134 #define USB_REQ_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40
135 #define USB_REQ_CDC_SET_ETHERNET_POWER_MANAGEMENT_PATTERNFILTER 0x41
136 #define USB_REQ_CDC_GET_ETHERNET_POWER_MANAGEMENT_PATTERNFILTER 0x42
137 #define USB_REQ_CDC_SET_ETHERNET_PACKET_FILTER 0x43
138 #define USB_REQ_CDC_GET_ETHERNET_STATISTIC 0x44
139 #define USB_REQ_CDC_SET_ATM_DATA_FORMAT 0x50
140 #define USB_REQ_CDC_GET_ATM_DEVICE_STATISTICS 0x51
141 #define USB_REQ_CDC_SET_ATM_DEFAULT_VC 0x52
142 #define USB_REQ_CDC_GET_ATM_VC_STATISTICS 0x53
143 // Added bNotification codes according cdc spec 1.1 chapter 6.3
144 #define USB_REQ_CDC_NOTIFY_RING_DETECT 0x09
145 #define USB_REQ_CDC_NOTIFY_SERIAL_STATE 0x20
146 #define USB_REQ_CDC_NOTIFY_CALL_STATE_CHANGE 0x28
147 #define USB_REQ_CDC_NOTIFY_LINE_STATE_CHANGE 0x29
148 
149 
150 /*
151  * Need to pack structures tightly, or the compiler might insert padding
152  * and violate the spec-mandated layout.
153  */
155 
156 
158 
159 
160 typedef struct {
167 
169 typedef struct {
173  uint8_t bmCapabilities;
174  uint8_t bDataInterface;
176 
178 typedef struct {
182  uint8_t bmCapabilities;
184 
186 typedef struct {
193 
194 
196 
197 #define CDC_CALL_MGMT_SUPPORTED (1 << 0)
199 #define CDC_CALL_MGMT_OVER_DCI (1 << 1)
201 
202 
204 
205 #define CDC_ACM_SUPPORT_FEATURE_REQUESTS (1 << 0)
208 #define CDC_ACM_SUPPORT_LINE_REQUESTS (1 << 1)
212 #define CDC_ACM_SUPPORT_SENDBREAK_REQUESTS (1 << 2)
214 #define CDC_ACM_SUPPORT_NOTIFY_REQUESTS (1 << 3)
216 
217 
218 
220 
221 
223 
224 typedef struct {
227  uint8_t bCharFormat;
228  uint8_t bParityType;
229  uint8_t bDataBits;
236 };
244 };
246 
249 
250 
252 typedef struct {
253  uint16_t value;
255 
257 
258 #define CDC_CTRL_SIGNAL_ACTIVATE_CARRIER (1 << 1)
263 #define CDC_CTRL_SIGNAL_DTE_PRESENT (1 << 0)
266 
267 
268 
269 
271 
272 
273 typedef struct {
274  uint8_t bmRequestType;
275  uint8_t bNotification;
280 
282 
283 
285 typedef struct {
289 
291 
292 #define CDC_SERIAL_STATE_DCD CPU_TO_LE16((1<<0))
293 #define CDC_SERIAL_STATE_DSR CPU_TO_LE16((1<<1))
294 #define CDC_SERIAL_STATE_BREAK CPU_TO_LE16((1<<2))
295 #define CDC_SERIAL_STATE_RING CPU_TO_LE16((1<<3))
296 #define CDC_SERIAL_STATE_FRAMING CPU_TO_LE16((1<<4))
297 #define CDC_SERIAL_STATE_PARITY CPU_TO_LE16((1<<5))
298 #define CDC_SERIAL_STATE_OVERRUN CPU_TO_LE16((1<<6))
299 
300 
303 
305 
306 
308 #endif // _USB_PROTOCOL_CDC_H_
cdc_char_format
Possible values of bCharFormat.
No parity.
#define COMPILER_PACK_RESET()
Set default alignment for subsequent struct and union definitions.
Definition: compiler.h:120
Odd parity.
uint32_t le32_t
Definition: compiler.h:254
#define COMPILER_PACK_SET(alignment)
Set maximum alignment for subsequent struct and union definitions to alignment.
Definition: compiler.h:113
Parity forced to 1 (mark)
Commonly used includes, types and macros.
CDC Call Management Functional Descriptor.
Control signal structure.
CDC Union Functional Descriptor.
uint16_t le16_t
Definition: compiler.h:250
Even parity.
cdc_parity
Possible values of bParityType.
Hardware handshake support (cdc spec 1.1 chapter 6.3.5)
1.5 stop bits
CDC Header Functional Descriptor.
Parity forced to 0 (space)
CDC ACM Functional Descriptor.
Line Coding structure.


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:05