Lightweight USB stack  1.0
usb_cdca.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 
23 #ifndef _USB_CDC_ATM_H_
24 #define _USB_CDC_ATM_H_
25 
26 #ifdef __cplusplus
27  extern "C" {
28 #endif
29 
30 
33 #define USB_CDC_SUBCLASS_ATM 0x07
34  /* @} */
35 
36 
39 #define USB_DTYPE_CDC_ATM 0x10
44 #define USB_CDC_SET_ATM_DATA_FORMAT 0x50
47 #define USB_CDC_GET_ATM_DEVICE_STATISTICS 0x51
49 #define USB_CDC_SET_ATM_DEFAULT_VC 0x52
51 #define USB_CDC_GET_ATM_VC_STATISTICS 0x53
57 #define ATM_STAT_US_CELLS_SENT 0x01
59 #define ATM_STAT_DS_CELLS_RECEIVED 0x02
61 #define ATM_STAT_DS_CELLS_USB_CONGESTION 0x03
64 #define ATM_STAT_DS_CELLS_AAL5_CRC_ERROR 0x04
67 #define ATM_STAT_DS_CELLS_HEC_ERROR 0x05
70 #define ATM_STAT_DS_CELLS_HEC_ERROR_CORRT 0x06
77 struct usb_cdc_atm_desc {
78  uint8_t bFunctionLength;
79  uint8_t bDescriptorType;
80  uint8_t bDescriptorSubType;
81  uint8_t iEndSystemIdentifier;
82  uint8_t bmDataCapabilities;
83  uint8_t bmATMDeviceStatistics;
85  uint16_t wType2MaxSegmentSize;
87  uint16_t wType3MaxSegmentSize;
89  uint16_t wMaxVC;
91 } __attribute__((packed));
92 
95 #ifdef __cplusplus
96  }
97 #endif
98 
99 #endif /* _USB_CDC_ATM_H_ */