Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
usb_cdc.h
Go to the documentation of this file.
1/* usb_cdc.h - USB CDC-ACM and CDC-ECM public header */
2
3/*
4 * Copyright (c) 2017 PHYTEC Messtechnik GmbH
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9
21#ifndef ZEPHYR_INCLUDE_USB_CLASS_USB_CDC_H_
22#define ZEPHYR_INCLUDE_USB_CLASS_USB_CDC_H_
23
25#define CDC_SRN_1_20 0x0120
26
28#define ACM_SUBCLASS 0x02
29#define ECM_SUBCLASS 0x06
30#define EEM_SUBCLASS 0x0c
31#define NCM_SUBCLASS 0x0d
32
34#define AT_CMD_V250_PROTOCOL 0x01
35#define EEM_PROTOCOL 0x07
36#define ACM_VENDOR_PROTOCOL 0xFF
37#define NCM_DATA_PROTOCOL 0x01
38
43#define DATA_INTERFACE_CLASS 0x0A
44
50#define HEADER_FUNC_DESC 0x00
51#define CALL_MANAGEMENT_FUNC_DESC 0x01
52#define ACM_FUNC_DESC 0x02
53#define UNION_FUNC_DESC 0x06
54#define ETHERNET_FUNC_DESC 0x0F
55#define ETHERNET_FUNC_DESC_NCM 0x1a
56
62#define CDC_SEND_ENC_CMD 0x00
63#define CDC_GET_ENC_RSP 0x01
64#define SET_LINE_CODING 0x20
65#define GET_LINE_CODING 0x21
66#define SET_CONTROL_LINE_STATE 0x22
67
72#define USB_CDC_NETWORK_CONNECTION 0x00
73#define USB_CDC_RESPONSE_AVAILABLE 0x01
74#define USB_CDC_AUX_JACK_HOOK_STATE 0x08
75#define USB_CDC_RING_DETECT 0x09
76#define USB_CDC_SERIAL_STATE 0x20
77#define USB_CDC_CALL_STATE_CHANGE 0x28
78#define USB_CDC_LINE_STATE_CHANGE 0x23
79
84#define USB_CDC_SERIAL_STATE_OVERRUN BIT(6)
85#define USB_CDC_SERIAL_STATE_PARITY BIT(5)
86#define USB_CDC_SERIAL_STATE_FRAMING BIT(4)
87#define USB_CDC_SERIAL_STATE_RINGSIGNAL BIT(3)
88#define USB_CDC_SERIAL_STATE_BREAK BIT(2)
89#define USB_CDC_SERIAL_STATE_TXCARRIER BIT(1)
90#define USB_CDC_SERIAL_STATE_RXCARRIER BIT(0)
91
93#define SET_CONTROL_LINE_STATE_RTS 0x02
94#define SET_CONTROL_LINE_STATE_DTR 0x01
95
97#define USB_CDC_LINE_CTRL_BAUD_RATE UART_LINE_CTRL_BAUD_RATE
98#define USB_CDC_LINE_CTRL_DCD UART_LINE_CTRL_DCD
99#define USB_CDC_LINE_CTRL_DSR UART_LINE_CTRL_DSR
100#define USB_CDC_LINE_CTRL_BREAK BIT(5)
101#define USB_CDC_LINE_CTRL_RING_SIGNAL BIT(6)
102#define USB_CDC_LINE_CTRL_FRAMING BIT(7)
103#define USB_CDC_LINE_CTRL_PARITY BIT(8)
104#define USB_CDC_LINE_CTRL_OVER_RUN BIT(9)
105
107#define SERIAL_STATE_OVER_RUN 0x40
108#define SERIAL_STATE_PARITY 0x20
109#define SERIAL_STATE_FRAMING 0x10
110#define SERIAL_STATE_RING_SIGNAL 0x08
111#define SERIAL_STATE_BREAK 0x04
112#define SERIAL_STATE_TX_CARRIER 0x02
113#define SERIAL_STATE_RX_CARRIER 0x01
114
120#define USB_CDC_LINE_CODING_STOP_BITS_1 0
121#define USB_CDC_LINE_CODING_STOP_BITS_1_5 1
122#define USB_CDC_LINE_CODING_STOP_BITS_2 2
123
124#define USB_CDC_LINE_CODING_PARITY_NO 0
125#define USB_CDC_LINE_CODING_PARITY_ODD 1
126#define USB_CDC_LINE_CODING_PARITY_EVEN 2
127#define USB_CDC_LINE_CODING_PARITY_MARK 3
128#define USB_CDC_LINE_CODING_PARITY_SPACE 4
129
130#define USB_CDC_LINE_CODING_DATA_BITS_5 5
131#define USB_CDC_LINE_CODING_DATA_BITS_6 6
132#define USB_CDC_LINE_CODING_DATA_BITS_7 7
133#define USB_CDC_LINE_CODING_DATA_BITS_8 8
134
139#define SET_ETHERNET_MULTICAST_FILTERS 0x40
140#define SET_ETHERNET_PM_FILTER 0x41
141#define GET_ETHERNET_PM_FILTER 0x42
142#define SET_ETHERNET_PACKET_FILTER 0x43
143#define GET_ETHERNET_STATISTIC 0x44
144
149#define GET_NTB_PARAMETERS 0x80
150#define GET_NET_ADDRESS 0x81
151#define SET_NET_ADDRESS 0x82
152#define GET_NTB_FORMAT 0x83
153#define SET_NTB_FORMAT 0x84
154#define GET_NTB_INPUT_SIZE 0x85
155#define SET_NTB_INPUT_SIZE 0x86
156#define GET_MAX_DATAGRAM_SIZE 0x87
157#define SET_MAX_DATAGRAM_SIZE 0x88
158#define GET_CRC_MODE 0x89
159#define SET_CRC_MODE 0x8A
160
162#define PACKET_TYPE_MULTICAST 0x10
163#define PACKET_TYPE_BROADCAST 0x08
164#define PACKET_TYPE_DIRECTED 0x04
165#define PACKET_TYPE_ALL_MULTICAST 0x02
166#define PACKET_TYPE_PROMISCUOUS 0x01
167
175
184
193
201
209
219
231
240
241#endif /* ZEPHYR_INCLUDE_USB_CLASS_USB_CDC_H_ */
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Abstract Control Management Functional Descriptor.
Definition usb_cdc.h:195
uint8_t bmCapabilities
Definition usb_cdc.h:199
uint8_t bFunctionLength
Definition usb_cdc.h:196
uint8_t bDescriptorType
Definition usb_cdc.h:197
uint8_t bDescriptorSubtype
Definition usb_cdc.h:198
Data structure for GET_LINE_CODING / SET_LINE_CODING class requests.
Definition usb_cdc.h:203
uint32_t dwDTERate
Definition usb_cdc.h:204
uint8_t bParityType
Definition usb_cdc.h:206
uint8_t bDataBits
Definition usb_cdc.h:207
uint8_t bCharFormat
Definition usb_cdc.h:205
Data structure for the notification about SerialState.
Definition usb_cdc.h:211
uint16_t wIndex
Definition usb_cdc.h:215
uint16_t wValue
Definition usb_cdc.h:214
uint16_t data
Definition usb_cdc.h:217
uint8_t bmRequestType
Definition usb_cdc.h:212
uint8_t bNotificationType
Definition usb_cdc.h:213
uint16_t wLength
Definition usb_cdc.h:216
Call Management Functional Descriptor.
Definition usb_cdc.h:186
uint8_t bDataInterface
Definition usb_cdc.h:191
uint8_t bFunctionLength
Definition usb_cdc.h:187
uint8_t bDescriptorSubtype
Definition usb_cdc.h:189
uint8_t bmCapabilities
Definition usb_cdc.h:190
uint8_t bDescriptorType
Definition usb_cdc.h:188
Ethernet Networking Functional Descriptor.
Definition usb_cdc.h:221
uint16_t wNumberMCFilters
Definition usb_cdc.h:228
uint32_t bmEthernetStatistics
Definition usb_cdc.h:226
uint8_t bFunctionLength
Definition usb_cdc.h:222
uint8_t bDescriptorSubtype
Definition usb_cdc.h:224
uint8_t iMACAddress
Definition usb_cdc.h:225
uint8_t bDescriptorType
Definition usb_cdc.h:223
uint8_t bNumberPowerFilters
Definition usb_cdc.h:229
uint16_t wMaxSegmentSize
Definition usb_cdc.h:227
Header Functional Descriptor.
Definition usb_cdc.h:169
uint8_t bDescriptorType
Definition usb_cdc.h:171
uint8_t bDescriptorSubtype
Definition usb_cdc.h:172
uint16_t bcdCDC
Definition usb_cdc.h:173
uint8_t bFunctionLength
Definition usb_cdc.h:170
Ethernet Network Control Model (NCM) Descriptor.
Definition usb_cdc.h:233
uint8_t bmNetworkCapabilities
Definition usb_cdc.h:238
uint8_t bFunctionLength
Definition usb_cdc.h:234
uint8_t bDescriptorType
Definition usb_cdc.h:235
uint8_t bDescriptorSubtype
Definition usb_cdc.h:236
uint16_t bcdNcmVersion
Definition usb_cdc.h:237
Union Interface Functional Descriptor.
Definition usb_cdc.h:177
uint8_t bSubordinateInterface0
Definition usb_cdc.h:182
uint8_t bControlInterface
Definition usb_cdc.h:181
uint8_t bDescriptorType
Definition usb_cdc.h:179
uint8_t bFunctionLength
Definition usb_cdc.h:178
uint8_t bDescriptorSubtype
Definition usb_cdc.h:180