Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
usb_cdc.h File Reference

USB Communications Device Class (CDC) public header. More...

Go to the source code of this file.

Data Structures

struct  cdc_header_descriptor
 
struct  cdc_union_descriptor
 
struct  cdc_cm_descriptor
 
struct  cdc_acm_descriptor
 
struct  cdc_acm_line_coding
 
struct  cdc_acm_notification
 
struct  cdc_ecm_descriptor
 

Macros

#define CDC_SRN_1_20   0x0120
 
#define ACM_SUBCLASS   0x02
 
#define ECM_SUBCLASS   0x06
 
#define EEM_SUBCLASS   0x0c
 
#define AT_CMD_V250_PROTOCOL   0x01
 
#define EEM_PROTOCOL   0x07
 
#define ACM_VENDOR_PROTOCOL   0xFF
 
#define DATA_INTERFACE_CLASS   0x0A
 Data Class Interface Codes. More...
 
#define HEADER_FUNC_DESC   0x00
 bDescriptor SubType for Communications Class Functional Descriptors More...
 
#define CALL_MANAGEMENT_FUNC_DESC   0x01
 
#define ACM_FUNC_DESC   0x02
 
#define UNION_FUNC_DESC   0x06
 
#define ETHERNET_FUNC_DESC   0x0F
 
#define CDC_SEND_ENC_CMD   0x00
 PSTN Subclass Specific Requests for ACM devices. More...
 
#define CDC_GET_ENC_RSP   0x01
 
#define SET_LINE_CODING   0x20
 
#define GET_LINE_CODING   0x21
 
#define SET_CONTROL_LINE_STATE   0x22
 
#define SET_CONTROL_LINE_STATE_RTS   0x02
 
#define SET_CONTROL_LINE_STATE_DTR   0x01
 
#define USB_CDC_LINE_CTRL_BAUD_RATE   UART_LINE_CTRL_BAUD_RATE
 
#define USB_CDC_LINE_CTRL_DCD   UART_LINE_CTRL_DCD
 
#define USB_CDC_LINE_CTRL_DSR   UART_LINE_CTRL_DSR
 
#define USB_CDC_LINE_CTRL_BREAK   BIT(5)
 
#define USB_CDC_LINE_CTRL_RING_SIGNAL   BIT(6)
 
#define USB_CDC_LINE_CTRL_FRAMING   BIT(7)
 
#define USB_CDC_LINE_CTRL_PARITY   BIT(8)
 
#define USB_CDC_LINE_CTRL_OVER_RUN   BIT(9)
 
#define SERIAL_STATE_OVER_RUN   0x40
 
#define SERIAL_STATE_PARITY   0x20
 
#define SERIAL_STATE_FRAMING   0x10
 
#define SERIAL_STATE_RING_SIGNAL   0x08
 
#define SERIAL_STATE_BREAK   0x04
 
#define SERIAL_STATE_TX_CARRIER   0x02
 
#define SERIAL_STATE_RX_CARRIER   0x01
 
#define SET_ETHERNET_MULTICAST_FILTERS   0x40
 Class-Specific Request Codes for Ethernet subclass. More...
 
#define SET_ETHERNET_PM_FILTER   0x41
 
#define GET_ETHERNET_PM_FILTER   0x42
 
#define SET_ETHERNET_PACKET_FILTER   0x43
 
#define GET_ETHERNET_STATISTIC   0x44
 
#define PACKET_TYPE_MULTICAST   0x10
 
#define PACKET_TYPE_BROADCAST   0x08
 
#define PACKET_TYPE_DIRECTED   0x04
 
#define PACKET_TYPE_ALL_MULTICAST   0x02
 
#define PACKET_TYPE_PROMISCUOUS   0x01
 

Detailed Description

USB Communications Device Class (CDC) public header.

Header follows the Class Definitions for Communications Devices Specification (CDC120-20101103-track.pdf), PSTN Devices Specification (PSTN120.pdf) and Ethernet Control Model Devices Specification (ECM120.pdf). Header is limited to ACM and ECM Subclasses.

Macro Definition Documentation

◆ ACM_FUNC_DESC

#define ACM_FUNC_DESC   0x02

◆ ACM_SUBCLASS

#define ACM_SUBCLASS   0x02

Communications Class Subclass Codes

◆ ACM_VENDOR_PROTOCOL

#define ACM_VENDOR_PROTOCOL   0xFF

◆ AT_CMD_V250_PROTOCOL

#define AT_CMD_V250_PROTOCOL   0x01

Communications Class Protocol Codes

◆ CALL_MANAGEMENT_FUNC_DESC

#define CALL_MANAGEMENT_FUNC_DESC   0x01

◆ CDC_GET_ENC_RSP

#define CDC_GET_ENC_RSP   0x01

◆ CDC_SEND_ENC_CMD

#define CDC_SEND_ENC_CMD   0x00

PSTN Subclass Specific Requests for ACM devices.

Note
PSTN120.pdf, 6.3, Table 13

◆ CDC_SRN_1_20

#define CDC_SRN_1_20   0x0120

CDC Specification release number in BCD format

◆ DATA_INTERFACE_CLASS

#define DATA_INTERFACE_CLASS   0x0A

Data Class Interface Codes.

Note
CDC120-20101103-track.pdf, 4.5, Table 6

◆ ECM_SUBCLASS

#define ECM_SUBCLASS   0x06

◆ EEM_PROTOCOL

#define EEM_PROTOCOL   0x07

◆ EEM_SUBCLASS

#define EEM_SUBCLASS   0x0c

◆ ETHERNET_FUNC_DESC

#define ETHERNET_FUNC_DESC   0x0F

◆ GET_ETHERNET_PM_FILTER

#define GET_ETHERNET_PM_FILTER   0x42

◆ GET_ETHERNET_STATISTIC

#define GET_ETHERNET_STATISTIC   0x44

◆ GET_LINE_CODING

#define GET_LINE_CODING   0x21

◆ HEADER_FUNC_DESC

#define HEADER_FUNC_DESC   0x00

bDescriptor SubType for Communications Class Functional Descriptors

Note
CDC120-20101103-track.pdf, 5.2.3, Table 13

◆ PACKET_TYPE_ALL_MULTICAST

#define PACKET_TYPE_ALL_MULTICAST   0x02

◆ PACKET_TYPE_BROADCAST

#define PACKET_TYPE_BROADCAST   0x08

◆ PACKET_TYPE_DIRECTED

#define PACKET_TYPE_DIRECTED   0x04

◆ PACKET_TYPE_MULTICAST

#define PACKET_TYPE_MULTICAST   0x10

Ethernet Packet Filter Bitmap

◆ PACKET_TYPE_PROMISCUOUS

#define PACKET_TYPE_PROMISCUOUS   0x01

◆ SERIAL_STATE_BREAK

#define SERIAL_STATE_BREAK   0x04

◆ SERIAL_STATE_FRAMING

#define SERIAL_STATE_FRAMING   0x10

◆ SERIAL_STATE_OVER_RUN

#define SERIAL_STATE_OVER_RUN   0x40

UART State Bitmap Values

◆ SERIAL_STATE_PARITY

#define SERIAL_STATE_PARITY   0x20

◆ SERIAL_STATE_RING_SIGNAL

#define SERIAL_STATE_RING_SIGNAL   0x08

◆ SERIAL_STATE_RX_CARRIER

#define SERIAL_STATE_RX_CARRIER   0x01

◆ SERIAL_STATE_TX_CARRIER

#define SERIAL_STATE_TX_CARRIER   0x02

◆ SET_CONTROL_LINE_STATE

#define SET_CONTROL_LINE_STATE   0x22

◆ SET_CONTROL_LINE_STATE_DTR

#define SET_CONTROL_LINE_STATE_DTR   0x01

◆ SET_CONTROL_LINE_STATE_RTS

#define SET_CONTROL_LINE_STATE_RTS   0x02

Control Signal Bitmap Values for SetControlLineState

◆ SET_ETHERNET_MULTICAST_FILTERS

#define SET_ETHERNET_MULTICAST_FILTERS   0x40

Class-Specific Request Codes for Ethernet subclass.

Note
ECM120.pdf, 6.2, Table 6

◆ SET_ETHERNET_PACKET_FILTER

#define SET_ETHERNET_PACKET_FILTER   0x43

◆ SET_ETHERNET_PM_FILTER

#define SET_ETHERNET_PM_FILTER   0x41

◆ SET_LINE_CODING

#define SET_LINE_CODING   0x20

◆ UNION_FUNC_DESC

#define UNION_FUNC_DESC   0x06

◆ USB_CDC_LINE_CTRL_BAUD_RATE

#define USB_CDC_LINE_CTRL_BAUD_RATE   UART_LINE_CTRL_BAUD_RATE

Enhance enum uart_line_ctrl with CDC specific values

◆ USB_CDC_LINE_CTRL_BREAK

#define USB_CDC_LINE_CTRL_BREAK   BIT(5)

◆ USB_CDC_LINE_CTRL_DCD

#define USB_CDC_LINE_CTRL_DCD   UART_LINE_CTRL_DCD

◆ USB_CDC_LINE_CTRL_DSR

#define USB_CDC_LINE_CTRL_DSR   UART_LINE_CTRL_DSR

◆ USB_CDC_LINE_CTRL_FRAMING

#define USB_CDC_LINE_CTRL_FRAMING   BIT(7)

◆ USB_CDC_LINE_CTRL_OVER_RUN

#define USB_CDC_LINE_CTRL_OVER_RUN   BIT(9)

◆ USB_CDC_LINE_CTRL_PARITY

#define USB_CDC_LINE_CTRL_PARITY   BIT(8)

◆ USB_CDC_LINE_CTRL_RING_SIGNAL

#define USB_CDC_LINE_CTRL_RING_SIGNAL   BIT(6)