ChibiOS/HAL  6.1.0
hal_usb_cdc.h
Go to the documentation of this file.
1 /*
2  ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 /**
18  * @file hal_usb_cdc.h
19  * @brief USB CDC macros and structures.
20  *
21  * @addtogroup USB_CDC
22  * @{
23  */
24 
25 #ifndef USB_CDC_H
26 #define USB_CDC_H
27 
28 /*===========================================================================*/
29 /* Driver constants. */
30 /*===========================================================================*/
31 
32 /**
33  * @name CDC specific messages.
34  * @{
35  */
36 #define CDC_SEND_ENCAPSULATED_COMMAND 0x00U
37 #define CDC_GET_ENCAPSULATED_RESPONSE 0x01U
38 #define CDC_SET_COMM_FEATURE 0x02U
39 #define CDC_GET_COMM_FEATURE 0x03U
40 #define CDC_CLEAR_COMM_FEATURE 0x04U
41 #define CDC_SET_AUX_LINE_STATE 0x10U
42 #define CDC_SET_HOOK_STATE 0x11U
43 #define CDC_PULSE_SETUP 0x12U
44 #define CDC_SEND_PULSE 0x13U
45 #define CDC_SET_PULSE_TIME 0x14U
46 #define CDC_RING_AUX_JACK 0x15U
47 #define CDC_SET_LINE_CODING 0x20U
48 #define CDC_GET_LINE_CODING 0x21U
49 #define CDC_SET_CONTROL_LINE_STATE 0x22U
50 #define CDC_SEND_BREAK 0x23U
51 #define CDC_SET_RINGER_PARMS 0x30U
52 #define CDC_GET_RINGER_PARMS 0x31U
53 #define CDC_SET_OPERATION_PARMS 0x32U
54 #define CDC_GET_OPERATION_PARMS 0x33U
55 /** @} */
56 
57 /**
58  * @name CDC classes
59  * @{
60  */
61 #define CDC_COMMUNICATION_INTERFACE_CLASS 0x02U
62 #define CDC_DATA_INTERFACE_CLASS 0x0AU
63 /** @} */
64 
65 /**
66  * @name CDC subclasses
67  * @{
68  */
69 #define CDC_ABSTRACT_CONTROL_MODEL 0x02U
70 /** @} */
71 
72 /**
73  * @name CDC descriptors
74  * @{
75  */
76 #define CDC_CS_INTERFACE 0x24U
77 /** @} */
78 
79 /**
80  * @name CDC subdescriptors
81  * @{
82  */
83 #define CDC_HEADER 0x00U
84 #define CDC_CALL_MANAGEMENT 0x01U
85 #define CDC_ABSTRACT_CONTROL_MANAGEMENT 0x02U
86 #define CDC_UNION 0x06U
87 /** @} */
88 
89 /**
90  * @name Line Control bit definitions.
91  * @{
92  */
93 #define LC_STOP_1 0U
94 #define LC_STOP_1P5 1U
95 #define LC_STOP_2 2U
96 
97 #define LC_PARITY_NONE 0U
98 #define LC_PARITY_ODD 1U
99 #define LC_PARITY_EVEN 2U
100 #define LC_PARITY_MARK 3U
101 #define LC_PARITY_SPACE 4U
102 /** @} */
103 
104 /*===========================================================================*/
105 /* Driver pre-compile time settings. */
106 /*===========================================================================*/
107 
108 /*===========================================================================*/
109 /* Derived constants and error checks. */
110 /*===========================================================================*/
111 
112 /*===========================================================================*/
113 /* Driver data structures and types. */
114 /*===========================================================================*/
115 
116 /**
117  * @brief Type of Line Coding structure.
118  */
119 typedef struct {
120  uint8_t dwDTERate[4];
121  uint8_t bCharFormat;
122  uint8_t bParityType;
123  uint8_t bDataBits;
125 
126 /*===========================================================================*/
127 /* Driver macros. */
128 /*===========================================================================*/
129 
130 /*===========================================================================*/
131 /* External declarations. */
132 /*===========================================================================*/
133 
134 #endif /* USB_CDC_H */
135 
136 /** @} */
Type of Line Coding structure.
Definition: hal_usb_cdc.h:119