Lightweight USB stack  1.0
usb_cdci.h
1 /* This file is the part of the Lightweight USB device Stack for STM32 microcontrollers
2  *
3  * Copyright ©2016 Dmitry Filimonchuk <dmitrystu[at]gmail[dot]com>
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  * http://www.apache.org/licenses/LICENSE-2.0
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
26 #ifndef _USB_CDC_ISDN_H_
27 #define _USB_CDC_ISDN_H_
28 
29 #ifdef __cplusplus
30  extern "C" {
31 #endif
32 
33 
36 #define USB_CDC_SUBCLASS_MCNL 0x04
37 #define USB_CDC_SUBCLASS_CAPI 0x05
38  /* @} */
39 
42 #define USB_CDC_PROTO_I340 0x30
43 #define USB_CDC_PROTO_HDLC 0x31
44 #define USB_CDC_PROTO_TRANSPARENT 0x32
45 #define USB_CDC_PROTO_Q921M 0x50
46 #define USB_CDC_PROTO_Q921 0x51
47 #define USB_CDC_PROTO_Q921TM 0x52
48 #define USB_CDC_PROTO_V42BIS 0x90
49 #define USB_CDC_PROTO_Q931 0x91
50 #define USB_CDC_PROTO_V120 0x92
51 #define USB_CDC_PROTO_CAPI20 0x93
56 #define USB_DTYPE_CDC_TERMINAL 0x09
57 #define USB_DTYPE_CDC_NETWORK_TERMINAL 0x0A
58 #define USB_DTYPE_CDC_PROTOCOL_UNIT 0x0B
59 #define USB_DTYPE_CDC_EXTENSION_UNIT 0x0C
60 #define USB_DTYPE_CDC_MCNL_MANAGEMENT 0x0D
61 #define USB_DTYPE_CDC_CAPI_CONTROL 0x0E
66 #define USB_CDC_SET_UNIT_PARAMETER 0x37
67 #define USB_CDC_GET_UNIT_PARAMETER 0x38
68 #define USB_CDC_CLEAR_UNIT_PARAMETER 0x39
70 #define USB_CDC_GET_PROFILE 0x3A
77 #define USB_CDC_MCHN_UNIT_NVRAM 0x01
79 #define USB_CDC_MCHN_UNIT_CLR 0x02
80 #define USB_CDC_MCHN_UNIR_SET 0x04
86 #define USB_CDC_CAPI_SIMPLE 0x00
87 #define USB_CDC_CAPI_INTELLIGENT 0x01
95 struct usb_cdc_terminal_desc {
96  uint8_t bFunctionLength;
97  uint8_t bDescriptorType;
98  uint8_t bDescriptorSubType;
99  uint8_t bEntityId;
100  uint8_t bInInterfaceNo;
101  uint8_t bOutInterfaceNo;
102  uint8_t bmOptions;
103  uint8_t bChildId0;
105  /* ... and there can be a lot of Terminals or Units */
106 } __attribute__ ((packed));
107 
113  uint8_t bFunctionLength;
114  uint8_t bDescriptorType;
116  uint8_t bEntityId;
117  uint8_t iName;
119  uint8_t bChannelIndex;
121  uint8_t bPhysicalInterface;
126 } __attribute__ ((packed));
127 
140  uint8_t bFunctionLength;
141  uint8_t bDescriptorType;
143  uint8_t bEntityId;
144  uint8_t bProtocol;
146 } __attribute__ ((packed));
152 struct usb_cdc_ext_unit_desc {
153  uint8_t bFunctionLength;
154  uint8_t bDescriptorType;
156  uint8_t bEntityId;
157  uint8_t bExtensionCode;
158  uint8_t iName;
160  uint8_t bChildId0;
162  /* ... and there can be a lot of Terminals or Units */
163 } __attribute__ ((packed));
164 
169  uint8_t bFunctionLength;
170  uint8_t bDescriptorType;
172  uint8_t bmCapabilities;
173 } __attribute__ ((packed));
178 struct usb_cdc_capi_ctl_desc {
179  uint8_t bFunctionLength;
180  uint8_t bDescriptorType;
182  uint8_t bmCapabilities;
183 } __attribute__ ((packed));
187 #ifdef __cplusplus
188  }
189 #endif
190 
191 #endif /* _USB_CDC_ISDN_H_ */
Extension Unit Functional Descriptor.
Definition: usb_cdci.h:155
uint8_t bPhysicalInterface
Type of physical interface.
Definition: usb_cdci.h:124
uint8_t bChannelIndex
The channel index of the associated network channel according to indexing rules below.
Definition: usb_cdci.h:122
CAPI Control Management Functional Descriptor.
Definition: usb_cdci.h:181
uint8_t bEntityId
Constant uniquely identifying the Terminal.
Definition: usb_cdci.h:119
uint8_t iName
Index of string descriptor, describing the name of the Network Channel Terminal.
Definition: usb_cdci.h:120
uint8_t bDescriptorType
CS_INTERFACE descriptor type.
Definition: usb_cdci.h:117
uint8_t bFunctionLength
Size of this functional descriptor, in bytes.
Definition: usb_cdci.h:116
uint8_t bDescriptorSubType
Network Channel Terminal Functional Descriptor.
Definition: usb_cdci.h:118
Protocol Unit Functional Descriptor.
Definition: usb_cdci.h:142
Multi-Channel Management Functional Descriptor.
Definition: usb_cdci.h:171
Network Channel Terminal Functional Descriptor.
Definition: usb_cdci.h:115