Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/usb/usb_cdc.h@0:01f31e923fe2, 2020-04-07 (annotated)
- Committer:
- Pawel Zarembski
- Date:
- Tue Apr 07 12:55:42 2020 +0200
- Revision:
- 0:01f31e923fe2
hani: DAPLink with reset workaround
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pawel Zarembski |
0:01f31e923fe2 | 1 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 2 | * @file usb_cdc.h |
Pawel Zarembski |
0:01f31e923fe2 | 3 | * @brief USB CDC driver header |
Pawel Zarembski |
0:01f31e923fe2 | 4 | * |
Pawel Zarembski |
0:01f31e923fe2 | 5 | * DAPLink Interface Firmware |
Pawel Zarembski |
0:01f31e923fe2 | 6 | * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved |
Pawel Zarembski |
0:01f31e923fe2 | 7 | * SPDX-License-Identifier: Apache-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 8 | * |
Pawel Zarembski |
0:01f31e923fe2 | 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
Pawel Zarembski |
0:01f31e923fe2 | 10 | * not use this file except in compliance with the License. |
Pawel Zarembski |
0:01f31e923fe2 | 11 | * You may obtain a copy of the License at |
Pawel Zarembski |
0:01f31e923fe2 | 12 | * |
Pawel Zarembski |
0:01f31e923fe2 | 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 14 | * |
Pawel Zarembski |
0:01f31e923fe2 | 15 | * Unless required by applicable law or agreed to in writing, software |
Pawel Zarembski |
0:01f31e923fe2 | 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
Pawel Zarembski |
0:01f31e923fe2 | 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Pawel Zarembski |
0:01f31e923fe2 | 18 | * See the License for the specific language governing permissions and |
Pawel Zarembski |
0:01f31e923fe2 | 19 | * limitations under the License. |
Pawel Zarembski |
0:01f31e923fe2 | 20 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 21 | |
Pawel Zarembski |
0:01f31e923fe2 | 22 | #ifndef __USB_CDC_H |
Pawel Zarembski |
0:01f31e923fe2 | 23 | #define __USB_CDC_H |
Pawel Zarembski |
0:01f31e923fe2 | 24 | |
Pawel Zarembski |
0:01f31e923fe2 | 25 | /*------------------------------------------------------------------------------ |
Pawel Zarembski |
0:01f31e923fe2 | 26 | * Definitions based on usbcdc11.pdf (www.usb.org) |
Pawel Zarembski |
0:01f31e923fe2 | 27 | *----------------------------------------------------------------------------*/ |
Pawel Zarembski |
0:01f31e923fe2 | 28 | /* Communication device class specification version 1.10 */ |
Pawel Zarembski |
0:01f31e923fe2 | 29 | #define CDC_V1_10 0x0110 |
Pawel Zarembski |
0:01f31e923fe2 | 30 | |
Pawel Zarembski |
0:01f31e923fe2 | 31 | /* Communication interface class code */ |
Pawel Zarembski |
0:01f31e923fe2 | 32 | /* (usbcdc11.pdf, 4.2, Table 15) */ |
Pawel Zarembski |
0:01f31e923fe2 | 33 | #define CDC_COMMUNICATION_INTERFACE_CLASS 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 34 | |
Pawel Zarembski |
0:01f31e923fe2 | 35 | /* Communication interface class subclass codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 36 | /* (usbcdc11.pdf, 4.3, Table 16) */ |
Pawel Zarembski |
0:01f31e923fe2 | 37 | #define CDC_DIRECT_LINE_CONTROL_MODEL 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 38 | #define CDC_ABSTRACT_CONTROL_MODEL 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 39 | #define CDC_TELEPHONE_CONTROL_MODEL 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 40 | #define CDC_MULTI_CHANNEL_CONTROL_MODEL 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 41 | #define CDC_CAPI_CONTROL_MODEL 0x05 |
Pawel Zarembski |
0:01f31e923fe2 | 42 | #define CDC_ETHERNET_NETWORKING_CONTROL_MODEL 0x06 |
Pawel Zarembski |
0:01f31e923fe2 | 43 | #define CDC_ATM_NETWORKING_CONTROL_MODEL 0x07 |
Pawel Zarembski |
0:01f31e923fe2 | 44 | |
Pawel Zarembski |
0:01f31e923fe2 | 45 | /* Communication interface class control protocol codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 46 | /* (usbcdc11.pdf, 4.4, Table 17) */ |
Pawel Zarembski |
0:01f31e923fe2 | 47 | #define CDC_PROTOCOL_COMMON_AT_COMMANDS 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 48 | |
Pawel Zarembski |
0:01f31e923fe2 | 49 | /* Data interface class code */ |
Pawel Zarembski |
0:01f31e923fe2 | 50 | /* (usbcdc11.pdf, 4.5, Table 18) */ |
Pawel Zarembski |
0:01f31e923fe2 | 51 | #define CDC_DATA_INTERFACE_CLASS 0x0A |
Pawel Zarembski |
0:01f31e923fe2 | 52 | |
Pawel Zarembski |
0:01f31e923fe2 | 53 | /* Data interface class protocol codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 54 | /* (usbcdc11.pdf, 4.7, Table 19) */ |
Pawel Zarembski |
0:01f31e923fe2 | 55 | #define CDC_PROTOCOL_ISDN_BRI 0x30 |
Pawel Zarembski |
0:01f31e923fe2 | 56 | #define CDC_PROTOCOL_HDLC 0x31 |
Pawel Zarembski |
0:01f31e923fe2 | 57 | #define CDC_PROTOCOL_TRANSPARENT 0x32 |
Pawel Zarembski |
0:01f31e923fe2 | 58 | #define CDC_PROTOCOL_Q921_MANAGEMENT 0x50 |
Pawel Zarembski |
0:01f31e923fe2 | 59 | #define CDC_PROTOCOL_Q921_DATA_LINK 0x51 |
Pawel Zarembski |
0:01f31e923fe2 | 60 | #define CDC_PROTOCOL_Q921_MULTIPLEXOR 0x52 |
Pawel Zarembski |
0:01f31e923fe2 | 61 | #define CDC_PROTOCOL_V42 0x90 |
Pawel Zarembski |
0:01f31e923fe2 | 62 | #define CDC_PROTOCOL_EURO_ISDN 0x91 |
Pawel Zarembski |
0:01f31e923fe2 | 63 | #define CDC_PROTOCOL_V24_RATE_ADAPTATION 0x92 |
Pawel Zarembski |
0:01f31e923fe2 | 64 | #define CDC_PROTOCOL_CAPI 0x93 |
Pawel Zarembski |
0:01f31e923fe2 | 65 | #define CDC_PROTOCOL_HOST_BASED_DRIVER 0xFD |
Pawel Zarembski |
0:01f31e923fe2 | 66 | #define CDC_PROTOCOL_DESCRIBED_IN_PUFD 0xFE |
Pawel Zarembski |
0:01f31e923fe2 | 67 | |
Pawel Zarembski |
0:01f31e923fe2 | 68 | /* Type values for bDescriptorType field of functional descriptors */ |
Pawel Zarembski |
0:01f31e923fe2 | 69 | /* (usbcdc11.pdf, 5.2.3, Table 24) */ |
Pawel Zarembski |
0:01f31e923fe2 | 70 | #define CDC_CS_INTERFACE 0x24 |
Pawel Zarembski |
0:01f31e923fe2 | 71 | #define CDC_CS_ENDPOINT 0x25 |
Pawel Zarembski |
0:01f31e923fe2 | 72 | |
Pawel Zarembski |
0:01f31e923fe2 | 73 | /* Type values for bDescriptorSubtype field of functional descriptors */ |
Pawel Zarembski |
0:01f31e923fe2 | 74 | /* (usbcdc11.pdf, 5.2.3, Table 25) */ |
Pawel Zarembski |
0:01f31e923fe2 | 75 | #define CDC_HEADER 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 76 | #define CDC_CALL_MANAGEMENT 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 77 | #define CDC_ABSTRACT_CONTROL_MANAGEMENT 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 78 | #define CDC_DIRECT_LINE_MANAGEMENT 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 79 | #define CDC_TELEPHONE_RINGER 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 80 | #define CDC_REPORTING_CAPABILITIES 0x05 |
Pawel Zarembski |
0:01f31e923fe2 | 81 | #define CDC_UNION 0x06 |
Pawel Zarembski |
0:01f31e923fe2 | 82 | #define CDC_COUNTRY_SELECTION 0x07 |
Pawel Zarembski |
0:01f31e923fe2 | 83 | #define CDC_TELEPHONE_OPERATIONAL_MODES 0x08 |
Pawel Zarembski |
0:01f31e923fe2 | 84 | #define CDC_USB_TERMINAL 0x09 |
Pawel Zarembski |
0:01f31e923fe2 | 85 | #define CDC_NETWORK_CHANNEL 0x0A |
Pawel Zarembski |
0:01f31e923fe2 | 86 | #define CDC_PROTOCOL_UNIT 0x0B |
Pawel Zarembski |
0:01f31e923fe2 | 87 | #define CDC_EXTENSION_UNIT 0x0C |
Pawel Zarembski |
0:01f31e923fe2 | 88 | #define CDC_MULTI_CHANNEL_MANAGEMENT 0x0D |
Pawel Zarembski |
0:01f31e923fe2 | 89 | #define CDC_CAPI_CONTROL_MANAGEMENT 0x0E |
Pawel Zarembski |
0:01f31e923fe2 | 90 | #define CDC_ETHERNET_NETWORKING 0x0F |
Pawel Zarembski |
0:01f31e923fe2 | 91 | #define CDC_ATM_NETWORKING 0x10 |
Pawel Zarembski |
0:01f31e923fe2 | 92 | |
Pawel Zarembski |
0:01f31e923fe2 | 93 | /* CDC class-specific request codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 94 | /* (usbcdc11.pdf, 6.2, Table 46) */ |
Pawel Zarembski |
0:01f31e923fe2 | 95 | /* see Table 45 for info about the specific requests. */ |
Pawel Zarembski |
0:01f31e923fe2 | 96 | #define CDC_SEND_ENCAPSULATED_COMMAND 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 97 | #define CDC_GET_ENCAPSULATED_RESPONSE 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 98 | #define CDC_SET_COMM_FEATURE 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 99 | #define CDC_GET_COMM_FEATURE 0x03 |
Pawel Zarembski |
0:01f31e923fe2 | 100 | #define CDC_CLEAR_COMM_FEATURE 0x04 |
Pawel Zarembski |
0:01f31e923fe2 | 101 | #define CDC_SET_AUX_LINE_STATE 0x10 |
Pawel Zarembski |
0:01f31e923fe2 | 102 | #define CDC_SET_HOOK_STATE 0x11 |
Pawel Zarembski |
0:01f31e923fe2 | 103 | #define CDC_PULSE_SETUP 0x12 |
Pawel Zarembski |
0:01f31e923fe2 | 104 | #define CDC_SEND_PULSE 0x13 |
Pawel Zarembski |
0:01f31e923fe2 | 105 | #define CDC_SET_PULSE_TIME 0x14 |
Pawel Zarembski |
0:01f31e923fe2 | 106 | #define CDC_RING_AUX_JACK 0x15 |
Pawel Zarembski |
0:01f31e923fe2 | 107 | #define CDC_SET_LINE_CODING 0x20 |
Pawel Zarembski |
0:01f31e923fe2 | 108 | #define CDC_GET_LINE_CODING 0x21 |
Pawel Zarembski |
0:01f31e923fe2 | 109 | #define CDC_SET_CONTROL_LINE_STATE 0x22 |
Pawel Zarembski |
0:01f31e923fe2 | 110 | #define CDC_SEND_BREAK 0x23 |
Pawel Zarembski |
0:01f31e923fe2 | 111 | #define CDC_SET_RINGER_PARMS 0x30 |
Pawel Zarembski |
0:01f31e923fe2 | 112 | #define CDC_GET_RINGER_PARMS 0x31 |
Pawel Zarembski |
0:01f31e923fe2 | 113 | #define CDC_SET_OPERATION_PARMS 0x32 |
Pawel Zarembski |
0:01f31e923fe2 | 114 | #define CDC_GET_OPERATION_PARMS 0x33 |
Pawel Zarembski |
0:01f31e923fe2 | 115 | #define CDC_SET_LINE_PARMS 0x34 |
Pawel Zarembski |
0:01f31e923fe2 | 116 | #define CDC_GET_LINE_PARMS 0x35 |
Pawel Zarembski |
0:01f31e923fe2 | 117 | #define CDC_DIAL_DIGITS 0x36 |
Pawel Zarembski |
0:01f31e923fe2 | 118 | #define CDC_SET_UNIT_PARAMETER 0x37 |
Pawel Zarembski |
0:01f31e923fe2 | 119 | #define CDC_GET_UNIT_PARAMETER 0x38 |
Pawel Zarembski |
0:01f31e923fe2 | 120 | #define CDC_CLEAR_UNIT_PARAMETER 0x39 |
Pawel Zarembski |
0:01f31e923fe2 | 121 | #define CDC_GET_PROFILE 0x3A |
Pawel Zarembski |
0:01f31e923fe2 | 122 | #define CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40 |
Pawel Zarembski |
0:01f31e923fe2 | 123 | #define CDC_SET_ETHERNET_PMP_FILTER 0x41 |
Pawel Zarembski |
0:01f31e923fe2 | 124 | #define CDC_GET_ETHERNET_PMP_FILTER 0x42 |
Pawel Zarembski |
0:01f31e923fe2 | 125 | #define CDC_SET_ETHERNET_PACKET_FILTER 0x43 |
Pawel Zarembski |
0:01f31e923fe2 | 126 | #define CDC_GET_ETHERNET_STATISTIC 0x44 |
Pawel Zarembski |
0:01f31e923fe2 | 127 | #define CDC_SET_ATM_DATA_FORMAT 0x50 |
Pawel Zarembski |
0:01f31e923fe2 | 128 | #define CDC_GET_ATM_DEVICE_STATISTICS 0x51 |
Pawel Zarembski |
0:01f31e923fe2 | 129 | #define CDC_SET_ATM_DEFAULT_VC 0x52 |
Pawel Zarembski |
0:01f31e923fe2 | 130 | #define CDC_GET_ATM_VC_STATISTICS 0x53 |
Pawel Zarembski |
0:01f31e923fe2 | 131 | |
Pawel Zarembski |
0:01f31e923fe2 | 132 | /* Communication feature selector codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 133 | /* (usbcdc11.pdf, 6.2.2..6.2.4, Table 47) */ |
Pawel Zarembski |
0:01f31e923fe2 | 134 | #define CDC_ABSTRACT_STATE 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 135 | #define CDC_COUNTRY_SETTING 0x02 |
Pawel Zarembski |
0:01f31e923fe2 | 136 | |
Pawel Zarembski |
0:01f31e923fe2 | 137 | /* Feature Status returned for ABSTRACT_STATE Selector */ |
Pawel Zarembski |
0:01f31e923fe2 | 138 | /* (usbcdc11.pdf, 6.2.3, Table 48) */ |
Pawel Zarembski |
0:01f31e923fe2 | 139 | #define CDC_IDLE_SETTING (1 << 0) |
Pawel Zarembski |
0:01f31e923fe2 | 140 | #define CDC_DATA_MULTPLEXED_STATE (1 << 1) |
Pawel Zarembski |
0:01f31e923fe2 | 141 | |
Pawel Zarembski |
0:01f31e923fe2 | 142 | |
Pawel Zarembski |
0:01f31e923fe2 | 143 | /* Control signal bitmap values for the SetControlLineState request */ |
Pawel Zarembski |
0:01f31e923fe2 | 144 | /* (usbcdc11.pdf, 6.2.14, Table 51) */ |
Pawel Zarembski |
0:01f31e923fe2 | 145 | #define CDC_DTE_PRESENT (1 << 0) |
Pawel Zarembski |
0:01f31e923fe2 | 146 | #define CDC_ACTIVATE_CARRIER (1 << 1) |
Pawel Zarembski |
0:01f31e923fe2 | 147 | |
Pawel Zarembski |
0:01f31e923fe2 | 148 | /* CDC class-specific notification codes */ |
Pawel Zarembski |
0:01f31e923fe2 | 149 | /* (usbcdc11.pdf, 6.3, Table 68) */ |
Pawel Zarembski |
0:01f31e923fe2 | 150 | /* see Table 67 for Info about class-specific notifications */ |
Pawel Zarembski |
0:01f31e923fe2 | 151 | #define CDC_NOTIFICATION_NETWORK_CONNECTION 0x00 |
Pawel Zarembski |
0:01f31e923fe2 | 152 | #define CDC_RESPONSE_AVAILABLE 0x01 |
Pawel Zarembski |
0:01f31e923fe2 | 153 | #define CDC_AUX_JACK_HOOK_STATE 0x08 |
Pawel Zarembski |
0:01f31e923fe2 | 154 | #define CDC_RING_DETECT 0x09 |
Pawel Zarembski |
0:01f31e923fe2 | 155 | #define CDC_NOTIFICATION_SERIAL_STATE 0x20 |
Pawel Zarembski |
0:01f31e923fe2 | 156 | #define CDC_CALL_STATE_CHANGE 0x28 |
Pawel Zarembski |
0:01f31e923fe2 | 157 | #define CDC_LINE_STATE_CHANGE 0x29 |
Pawel Zarembski |
0:01f31e923fe2 | 158 | #define CDC_CONNECTION_SPEED_CHANGE 0x2A |
Pawel Zarembski |
0:01f31e923fe2 | 159 | |
Pawel Zarembski |
0:01f31e923fe2 | 160 | /* UART state bitmap values (Serial state notification). */ |
Pawel Zarembski |
0:01f31e923fe2 | 161 | /* (usbcdc11.pdf, 6.3.5, Table 69) */ |
Pawel Zarembski |
0:01f31e923fe2 | 162 | #define CDC_SERIAL_STATE_OVERRUN (1 << 6) /* receive data overrun error has occurred */ |
Pawel Zarembski |
0:01f31e923fe2 | 163 | #define CDC_SERIAL_STATE_OVERRUN_Pos ( 6) |
Pawel Zarembski |
0:01f31e923fe2 | 164 | #define CDC_SERIAL_STATE_OVERRUN_Msk (1 << CDC_SERIAL_STATE_OVERRUN_Pos) |
Pawel Zarembski |
0:01f31e923fe2 | 165 | #define CDC_SERIAL_STATE_PARITY (1 << 5) /* parity error has occurred */ |
Pawel Zarembski |
0:01f31e923fe2 | 166 | #define CDC_SERIAL_STATE_PARITY_Pos ( 5) |
Pawel Zarembski |
0:01f31e923fe2 | 167 | #define CDC_SERIAL_STATE_PARITY_Msk (1 << CDC_SERIAL_STATE_PARITY_Pos) |
Pawel Zarembski |
0:01f31e923fe2 | 168 | #define CDC_SERIAL_STATE_FRAMING (1 << 4) /* framing error has occurred */ |
Pawel Zarembski |
0:01f31e923fe2 | 169 | #define CDC_SERIAL_STATE_FRAMING_Pos ( 4) |
Pawel Zarembski |
0:01f31e923fe2 | 170 | #define CDC_SERIAL_STATE_FRAMING_Msk (1 << CDC_SERIAL_STATE_FRAMING_Pos) |
Pawel Zarembski |
0:01f31e923fe2 | 171 | #define CDC_SERIAL_STATE_RING (1 << 3) /* state of ring signal detection */ |
Pawel Zarembski |
0:01f31e923fe2 | 172 | #define CDC_SERIAL_STATE_RING_Pos ( 3) |
Pawel Zarembski |
0:01f31e923fe2 | 173 | #define CDC_SERIAL_STATE_RING_Msk (1 << CDC_SERIAL_STATE_RING_Pos) |
Pawel Zarembski |
0:01f31e923fe2 | 174 | #define CDC_SERIAL_STATE_BREAK (1 << 2) /* state of break detection */ |
Pawel Zarembski |
0:01f31e923fe2 | 175 | #define CDC_SERIAL_STATE_BREAK_Pos ( 2) |
Pawel Zarembski |
0:01f31e923fe2 | 176 | #define CDC_SERIAL_STATE_BREAK_Msk (1 << CDC_SERIAL_STATE_BREAK_Pos) |
Pawel Zarembski |
0:01f31e923fe2 | 177 | #define CDC_SERIAL_STATE_TX_CARRIER (1 << 1) /* state of transmission carrier */ |
Pawel Zarembski |
0:01f31e923fe2 | 178 | #define CDC_SERIAL_STATE_TX_CARRIER_Pos ( 1) |
Pawel Zarembski |
0:01f31e923fe2 | 179 | #define CDC_SERIAL_STATE_TX_CARRIER_Msk (1 << CDC_SERIAL_STATE_TX_CARRIER_Pos) |
Pawel Zarembski |
0:01f31e923fe2 | 180 | #define CDC_SERIAL_STATE_RX_CARRIER (1 << 0) /* state of receiver carrier */ |
Pawel Zarembski |
0:01f31e923fe2 | 181 | #define CDC_SERIAL_STATE_RX_CARRIER_Pos ( 0) |
Pawel Zarembski |
0:01f31e923fe2 | 182 | #define CDC_SERIAL_STATE_RX_CARRIER_Msk (1 << CDC_SERIAL_STATE_RX_CARRIER_Pos) |
Pawel Zarembski |
0:01f31e923fe2 | 183 | |
Pawel Zarembski |
0:01f31e923fe2 | 184 | |
Pawel Zarembski |
0:01f31e923fe2 | 185 | /*------------------------------------------------------------------------------ |
Pawel Zarembski |
0:01f31e923fe2 | 186 | * Structures based on usbcdc11.pdf (www.usb.org) |
Pawel Zarembski |
0:01f31e923fe2 | 187 | *----------------------------------------------------------------------------*/ |
Pawel Zarembski |
0:01f31e923fe2 | 188 | |
Pawel Zarembski |
0:01f31e923fe2 | 189 | /* Header functional descriptor */ |
Pawel Zarembski |
0:01f31e923fe2 | 190 | /* (usbcdc11.pdf, 5.2.3.1) */ |
Pawel Zarembski |
0:01f31e923fe2 | 191 | /* This header must precede any list of class-specific descriptors. */ |
Pawel Zarembski |
0:01f31e923fe2 | 192 | typedef __packed struct _CDC_HEADER_DESCRIPTOR { |
Pawel Zarembski |
0:01f31e923fe2 | 193 | U8 bFunctionLength; /* size of this descriptor in bytes */ |
Pawel Zarembski |
0:01f31e923fe2 | 194 | U8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
Pawel Zarembski |
0:01f31e923fe2 | 195 | U8 bDescriptorSubtype; /* Header functional descriptor subtype */ |
Pawel Zarembski |
0:01f31e923fe2 | 196 | U16 bcdCDC; /* USB CDC specification release version */ |
Pawel Zarembski |
0:01f31e923fe2 | 197 | } CDC_HEADER_DESCRIPTOR; |
Pawel Zarembski |
0:01f31e923fe2 | 198 | |
Pawel Zarembski |
0:01f31e923fe2 | 199 | /* Call management functional descriptor */ |
Pawel Zarembski |
0:01f31e923fe2 | 200 | /* (usbcdc11.pdf, 5.2.3.2) */ |
Pawel Zarembski |
0:01f31e923fe2 | 201 | /* Describes the processing of calls for the communication class interface. */ |
Pawel Zarembski |
0:01f31e923fe2 | 202 | typedef __packed struct _CDC_CALL_MANAGEMENT_DESCRIPTOR { |
Pawel Zarembski |
0:01f31e923fe2 | 203 | U8 bFunctionLength; /* size of this descriptor in bytes */ |
Pawel Zarembski |
0:01f31e923fe2 | 204 | U8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
Pawel Zarembski |
0:01f31e923fe2 | 205 | U8 bDescriptorSubtype; /* call management functional descriptor subtype */ |
Pawel Zarembski |
0:01f31e923fe2 | 206 | U8 bmCapabilities; /* capabilities that this configuration supports */ |
Pawel Zarembski |
0:01f31e923fe2 | 207 | U8 bDataInterface; /* interface number of the data class interface used for call management (optional) */ |
Pawel Zarembski |
0:01f31e923fe2 | 208 | } CDC_CALL_MANAGEMENT_DESCRIPTOR; |
Pawel Zarembski |
0:01f31e923fe2 | 209 | |
Pawel Zarembski |
0:01f31e923fe2 | 210 | /* Abstract control management functional descriptor */ |
Pawel Zarembski |
0:01f31e923fe2 | 211 | /* (usbcdc11.pdf, 5.2.3.3) */ |
Pawel Zarembski |
0:01f31e923fe2 | 212 | /* Describes the command supported by the communication interface class with the Abstract Control Model subclass code. */ |
Pawel Zarembski |
0:01f31e923fe2 | 213 | typedef __packed struct _CDC_ABSTRACT_CONTROL_MANAGEMENT_DESCRIPTOR { |
Pawel Zarembski |
0:01f31e923fe2 | 214 | U8 bFunctionLength; /* size of this descriptor in bytes */ |
Pawel Zarembski |
0:01f31e923fe2 | 215 | U8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
Pawel Zarembski |
0:01f31e923fe2 | 216 | U8 bDescriptorSubtype; /* abstract control management functional descriptor subtype */ |
Pawel Zarembski |
0:01f31e923fe2 | 217 | U8 bmCapabilities; /* capabilities supported by this configuration */ |
Pawel Zarembski |
0:01f31e923fe2 | 218 | } CDC_ABSTRACT_CONTROL_MANAGEMENT_DESCRIPTOR; |
Pawel Zarembski |
0:01f31e923fe2 | 219 | |
Pawel Zarembski |
0:01f31e923fe2 | 220 | /* Union functional descriptors */ |
Pawel Zarembski |
0:01f31e923fe2 | 221 | /* (usbcdc11.pdf, 5.2.3.8) */ |
Pawel Zarembski |
0:01f31e923fe2 | 222 | /* Describes the relationship between a group of interfaces that can be considered to form a functional unit. */ |
Pawel Zarembski |
0:01f31e923fe2 | 223 | typedef __packed struct _CDC_UNION_DESCRIPTOR { |
Pawel Zarembski |
0:01f31e923fe2 | 224 | U8 bFunctionLength; /* size of this descriptor in bytes */ |
Pawel Zarembski |
0:01f31e923fe2 | 225 | U8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
Pawel Zarembski |
0:01f31e923fe2 | 226 | U8 bDescriptorSubtype; /* union functional descriptor subtype */ |
Pawel Zarembski |
0:01f31e923fe2 | 227 | U8 bMasterInterface; /* interface number designated as master */ |
Pawel Zarembski |
0:01f31e923fe2 | 228 | } CDC_UNION_DESCRIPTOR; |
Pawel Zarembski |
0:01f31e923fe2 | 229 | |
Pawel Zarembski |
0:01f31e923fe2 | 230 | /* Union functional descriptors with one slave interface */ |
Pawel Zarembski |
0:01f31e923fe2 | 231 | /* (usbcdc11.pdf, 5.2.3.8) */ |
Pawel Zarembski |
0:01f31e923fe2 | 232 | typedef __packed struct _CDC_UNION_1SLAVE_DESCRIPTOR { |
Pawel Zarembski |
0:01f31e923fe2 | 233 | CDC_UNION_DESCRIPTOR sUnion; /* Union functional descriptor */ |
Pawel Zarembski |
0:01f31e923fe2 | 234 | U8 bSlaveInterfaces[1]; /* Slave interface 0 */ |
Pawel Zarembski |
0:01f31e923fe2 | 235 | } CDC_UNION_1SLAVE_DESCRIPTOR; |
Pawel Zarembski |
0:01f31e923fe2 | 236 | |
Pawel Zarembski |
0:01f31e923fe2 | 237 | /* Line coding structure */ |
Pawel Zarembski |
0:01f31e923fe2 | 238 | /* Format of the data returned when a GetLineCoding request is received */ |
Pawel Zarembski |
0:01f31e923fe2 | 239 | /* (usbcdc11.pdf, 6.2.13) */ |
Pawel Zarembski |
0:01f31e923fe2 | 240 | typedef __packed struct _CDC_LINE_CODING { |
Pawel Zarembski |
0:01f31e923fe2 | 241 | U32 dwDTERate; /* Data terminal rate in bits per second */ |
Pawel Zarembski |
0:01f31e923fe2 | 242 | U8 bCharFormat; /* Number of stop bits */ |
Pawel Zarembski |
0:01f31e923fe2 | 243 | U8 bParityType; /* Parity bit type */ |
Pawel Zarembski |
0:01f31e923fe2 | 244 | U8 bDataBits; /* Number of data bits */ |
Pawel Zarembski |
0:01f31e923fe2 | 245 | } CDC_LINE_CODING; |
Pawel Zarembski |
0:01f31e923fe2 | 246 | |
Pawel Zarembski |
0:01f31e923fe2 | 247 | /* Notification header */ |
Pawel Zarembski |
0:01f31e923fe2 | 248 | /* Data sent on the notification endpoint must follow this header. */ |
Pawel Zarembski |
0:01f31e923fe2 | 249 | /* see USB_SETUP_PACKET in file usb.h */ |
Pawel Zarembski |
0:01f31e923fe2 | 250 | typedef USB_SETUP_PACKET CDC_NOTIFICATION_HEADER; |
Pawel Zarembski |
0:01f31e923fe2 | 251 | |
Pawel Zarembski |
0:01f31e923fe2 | 252 | #endif /* __USB_CDC_H */ |
Pawel Zarembski |
0:01f31e923fe2 | 253 |