ARMEBS4  revision-26.06.2015
usbd_cdc_core.h
1 #include "heivs/config.h"
2 #if (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE)
3 /**
4  ******************************************************************************
5  * @file usbd_cdc_core.h
6  * @author MCD Application Team
7  * @version V1.1.0
8  * @date 19-March-2012
9  * @brief header file for the usbd_cdc_core.c file.
10  ******************************************************************************
11  * @attention
12  *
13  * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>
14  *
15  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
16  * You may not use this file except in compliance with the License.
17  * You may obtain a copy of the License at:
18  *
19  * http://www.st.com/software_license_agreement_liberty_v2
20  *
21  * Unless required by applicable law or agreed to in writing, software
22  * distributed under the License is distributed on an "AS IS" BASIS,
23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24  * See the License for the specific language governing permissions and
25  * limitations under the License.
26  *
27  ******************************************************************************
28  */
29 
30 /* Includes ------------------------------------------------------------------*/
31 
32 #ifndef __USB_CDC_CORE_H_
33 #define __USB_CDC_CORE_H_
34 
35 #include "usbd_ioreq.h"
36 
37 /** @addtogroup STM32_USB_OTG_DEVICE_LIBRARY
38  * @{
39  */
40 
41 /** @defgroup usbd_cdc
42  * @brief This file is the Header file for USBD_cdc.c
43  * @{
44  */
45 
46 
47 /** @defgroup usbd_cdc_Exported_Defines
48  * @{
49  */
50 #define USB_CDC_CONFIG_DESC_SIZ (67)
51 #define USB_CDC_DESC_SIZ (67-9)
52 
53 #define CDC_DESCRIPTOR_TYPE 0x21
54 
55 #define DEVICE_CLASS_CDC 0x02
56 #define DEVICE_SUBCLASS_CDC 0x00
57 
58 
59 #define USB_DEVICE_DESCRIPTOR_TYPE 0x01
60 #define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02
61 #define USB_STRING_DESCRIPTOR_TYPE 0x03
62 #define USB_INTERFACE_DESCRIPTOR_TYPE 0x04
63 #define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05
64 
65 #define STANDARD_ENDPOINT_DESC_SIZE 0x09
66 
67 #define CDC_DATA_IN_PACKET_SIZE *(uint16_t *)(((USB_OTG_CORE_HANDLE *)pdev)->dev.pConfig_descriptor + 57)
68 
69 #define CDC_DATA_OUT_PACKET_SIZE *(uint16_t *)(((USB_OTG_CORE_HANDLE *)pdev)->dev.pConfig_descriptor + 64)
70 
71 #define CDC_IN_EP 0x81 /* EP1 for data IN */
72 #define CDC_OUT_EP 0x01 /* EP1 for data OUT */
73 #define CDC_CMD_EP 0x83 /* EP2 for CDC commands */
74 
75 /*---------------------------------------------------------------------*/
76 /* CDC definitions */
77 /*---------------------------------------------------------------------*/
78 
79 /**************************************************/
80 /* CDC Requests */
81 /**************************************************/
82 #define SEND_ENCAPSULATED_COMMAND 0x00
83 #define GET_ENCAPSULATED_RESPONSE 0x01
84 #define SET_COMM_FEATURE 0x02
85 #define GET_COMM_FEATURE 0x03
86 #define CLEAR_COMM_FEATURE 0x04
87 #define SET_LINE_CODING 0x20
88 #define GET_LINE_CODING 0x21
89 #define SET_CONTROL_LINE_STATE 0x22
90 #define SEND_BREAK 0x23
91 #define NO_CMD 0xFF
92 
93 /**
94  * @}
95  */
96 
97 
98 /** @defgroup USBD_CORE_Exported_TypesDefinitions
99  * @{
100  */
101 typedef struct _CDC_IF_PROP
102 {
103  uint16_t (*pIf_Init) (void);
104  uint16_t (*pIf_DeInit) (void);
105  uint16_t (*pIf_Ctrl) (uint32_t Cmd, const uint8_t* Buf, uint32_t Len);
106  uint16_t (*pIf_DataRx) (const uint32_t* Buf, uint32_t Len);
107  uint16_t (*pIf_DataTxEmpty)(void);
108 }
109 CDC_IF_Prop_TypeDef;
110 /**
111  * @}
112  */
113 
114 
115 
116 /** @defgroup USBD_CORE_Exported_Macros
117  * @{
118  */
119 
120 /**
121  * @}
122  */
123 
124 /** @defgroup USBD_CORE_Exported_Variables
125  * @{
126  */
127 
128 extern USBD_Class_cb_TypeDef USBD_CDC_cb;
129 /**
130  * @}
131  */
132 
133 /** @defgroup USB_CORE_Exported_Functions
134  * @{
135  */
136 /**
137  * @}
138  */
139 
140 #endif // __USB_CDC_CORE_H_
141 /**
142  * @}
143  */
144 
145 /**
146  * @}
147  */
148 
149 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
150 #endif /* (USE_STM32_USB_HOST_MODE || USE_STM32_USB_USE_DEVICE_MODE || USE_STM32_USB_OTG_MODE) */
libheivs configuration file