Loading...
Searching...
No Matches
CDC - USB communications device class

Generic USB CDC defines and helpers. More...

Detailed Description

Generic USB CDC defines and helpers.

Files

file  cdc.h
 Definition for USB CDC interfaces.
 

Data Structures

struct  usb_desc_ecm_t
 USB CDC ECM descriptor. More...
 
struct  usb_desc_acm_t
 USB CDC ACM descriptor. More...
 
struct  usb_desc_cdc_t
 Generic USB CDC descriptor. More...
 
struct  usb_desc_union_t
 USB union descriptor. More...
 
struct  usb_desc_call_mngt_t
 USB CDC call management functional descriptor. More...
 
struct  usb_desc_cdcecm_speed_t
 USB CDC ECM connection speed change notification. More...
 
struct  usb_req_cdcacm_coding_t
 USB CDC ACM line coding setup content. More...
 

Macros

#define USB_TYPE_DESCRIPTOR_CDC   0x24
 USB CDC type descriptor.
 
#define USB_CDC_VERSION_BCD   0x0120
 USB CDC version in BCD.
 

USB CDC subclass types

#define USB_CDC_SUBCLASS_NONE   0x00
 No subclass.
 
#define USB_CDC_SUBCLASS_DLCM   0x01
 Direct Line Control Model.
 
#define USB_CDC_SUBCLASS_ACM   0x02
 Abstract Control Model.
 
#define USB_CDC_SUBCLASS_TCM   0x03
 Telephone Control Model.
 
#define USB_CDC_SUBCLASS_MCCM   0x04
 Multi-Channel Control Model.
 
#define USB_CDC_SUBCLASS_CCM   0x05
 CAPI Control Mode.
 
#define USB_CDC_SUBCLASS_ENCM   0x06
 Eth Networking Control Model.
 
#define USB_CDC_SUBCLASS_ANCM   0x07
 ATM Networking Control Model.
 
#define USB_CDC_SUBCLASS_WHCM   0x08
 Wireless Handset Control Model.
 
#define USB_CDC_SUBCLASS_DM   0x09
 Device Management.
 
#define USB_CDC_SUBCLASS_MDLM   0x0A
 Mobile Direct Line Model.
 
#define USB_CDC_SUBCLASS_OBEX   0x0B
 OBEX.
 
#define USB_CDC_SUBCLASS_EEM   0x0C
 Ethernet Emulation Model.
 
#define USB_CDC_SUBCLASS_NCM   0x0D
 Network Control Model.
 

USB CDC protocol types

#define USB_CDC_PROTOCOL_NONE   0x00
 No protocol required.
 
#define USB_CDC_PROTOCOL_ITU   0x01
 AT Commands: V.250 etc.
 
#define USB_CDC_PROTOCOL_PCCA   0x02
 AT Commands defined by PCCA-101.
 
#define USB_CDC_PROTOCOL_PCCA_A   0x03
 AT Commands defined by PCCA-101 & Annex O.
 
#define USB_CDC_PROTOCOL_GSM   0x04
 AT Commands defined by GSM 07.07.
 
#define USB_CDC_PROTOCOL_3GPP   0x05
 AT Commands defined by 3GPP 27.007.
 
#define USB_CDC_PROTOCOL_CS   0x06
 AT Commands defined by TIA for CDMA.
 
#define USB_CDC_PROTOCOL_EEM   0x07
 Ethernet Emulation Model.
 
#define USB_CDC_PROTOCOL_EXT   0xFE
 External Protocol.
 
#define USB_CDC_PROTOCOL_VENDOR   0xFF
 Vendor-specific.
 

USB CDC descriptor subtypes

#define USB_CDC_DESCR_SUBTYPE_FUNCTIONAL   0x00
 functional descriptor
 
#define USB_CDC_DESCR_SUBTYPE_CALL_MGMT   0x01
 Call management descriptor.
 
#define USB_CDC_DESCR_SUBTYPE_ACM   0x02
 Abstract control management descriptor.
 
#define USB_CDC_DESCR_SUBTYPE_UNION   0x06
 Union descriptor.
 
#define USB_CDC_DESCR_SUBTYPE_ETH_NET   0x0f
 Ethernet descriptor.
 

USB CDC management requests

#define USB_CDC_MGNT_REQUEST_SET_LINE_CODING   (0x20)
 Set line character formatting properties.
 
#define USB_CDC_MGNT_REQUEST_GET_LINE_CODING   (0x21)
 Request the currently configured line coding.
 
#define USB_CDC_MGNT_REQUEST_SET_CONTROL_LINE_STATE   (0x22)
 Set the control line state.
 
#define USB_CDC_MGNT_REQUEST_SET_ETH_MULTICAST_FILTER   0x40
 Set ethernet multicast filter request.
 
#define USB_CDC_MGNT_REQUEST_SET_ETH_PM_PATTERN_FILTER   0x41
 Set ethernet power management pattern filter.
 
#define USB_CDC_MGNT_REQUEST_GET_ETH_PM_PATTERN_FILTER   0x42
 Get ethernet power management pattern filter.
 
#define USB_CDC_MGNT_REQUEST_SET_ETH_PACKET_FILTER   0x43
 Set ethernet packet filter.
 
#define USB_CDC_MGNT_REQUEST_GET_ETH_STATISTICS   0x44
 Get ethernet statistics.
 

USB CDC ACM control line state flags

#define USB_CDC_ACM_CONTROL_LINE_DTE   (0x01)
 DTE (e.g.
 
#define USB_CDC_ACM_CONTROL_LINE_CARRIER   (0x02)
 Activate carrier control for half duplex modems.
 

USB CDC management notifications

#define USB_CDC_MGNT_NOTIF_NETWORK_CONNECTION   0x00
 Network connection status notification.
 
#define USB_CDC_MGNT_NOTIF_RESPONSE_AVAILABLE   0x01
 Response available notification.
 
#define USB_CDC_MGNT_NOTIF_AUX_JACK_HOOK_STATE   0x08
 Hook on the auxiliary phone changed notification.
 
#define USB_CDC_MGNT_NOTIF_RING_DETECT   0x09
 Ring voltage on the POTS line interface notification.
 
#define USB_CDC_MGNT_NOTIF_SERIAL_STATE   0x20
 Asynchronous UART status notification.
 
#define USB_CDC_MGNT_NOTIF_CALL_STATE_CHANGE   0x28
 Call state change notification.
 
#define USB_CDC_MGNT_NOTIF_LINE_STATE_CHANGE   0x29
 Line state change notification.
 
#define USB_CDC_MGNT_NOTIF_CONN_SPEED_CHANGE   0x2A
 Throughput change notification.
 

USB CDC ACM line coding setup defines

#define USB_CDC_ACM_CODING_STOP_BITS_1   0
 1 stop bit

 
#define USB_CDC_ACM_CODING_STOP_BITS_1_5   1
 1.5 stop bits
 
#define USB_CDC_ACM_CODING_STOP_BITS_2   2
 2 stop bits

 
#define USB_CDC_ACM_CODING_PARITY_NONE   0
 No parity bit.
 
#define USB_CDC_ACM_CODING_PARITY_ODD   1
 Odd parity

 
#define USB_CDC_ACM_CODING_PARITY_EVEN   2
 Even parity

 
#define USB_CDC_ACM_CODING_PARITY_MARK   3
 Mark parity

 
#define USB_CDC_ACM_CODING_PARITY_SPACE   4
 Space parity

 

Macro Definition Documentation

◆ USB_CDC_ACM_CODING_PARITY_EVEN

#define USB_CDC_ACM_CODING_PARITY_EVEN   2

Even parity

Definition at line 295 of file cdc.h.

◆ USB_CDC_ACM_CODING_PARITY_MARK

#define USB_CDC_ACM_CODING_PARITY_MARK   3

Mark parity

Definition at line 296 of file cdc.h.

◆ USB_CDC_ACM_CODING_PARITY_NONE

#define USB_CDC_ACM_CODING_PARITY_NONE   0

No parity bit.

Definition at line 293 of file cdc.h.

◆ USB_CDC_ACM_CODING_PARITY_ODD

#define USB_CDC_ACM_CODING_PARITY_ODD   1

Odd parity

Definition at line 294 of file cdc.h.

◆ USB_CDC_ACM_CODING_PARITY_SPACE

#define USB_CDC_ACM_CODING_PARITY_SPACE   4

Space parity

Definition at line 297 of file cdc.h.

◆ USB_CDC_ACM_CODING_STOP_BITS_1

#define USB_CDC_ACM_CODING_STOP_BITS_1   0

1 stop bit

Definition at line 289 of file cdc.h.

◆ USB_CDC_ACM_CODING_STOP_BITS_1_5

#define USB_CDC_ACM_CODING_STOP_BITS_1_5   1

1.5 stop bits

Definition at line 290 of file cdc.h.

◆ USB_CDC_ACM_CODING_STOP_BITS_2

#define USB_CDC_ACM_CODING_STOP_BITS_2   2

2 stop bits

Definition at line 291 of file cdc.h.

◆ USB_CDC_ACM_CONTROL_LINE_CARRIER

#define USB_CDC_ACM_CONTROL_LINE_CARRIER   (0x02)

Activate carrier control for half duplex modems.

Definition at line 148 of file cdc.h.

◆ USB_CDC_ACM_CONTROL_LINE_DTE

#define USB_CDC_ACM_CONTROL_LINE_DTE   (0x01)

DTE (e.g.

a PC) is present and listening

Definition at line 143 of file cdc.h.

◆ USB_CDC_DESCR_SUBTYPE_ACM

#define USB_CDC_DESCR_SUBTYPE_ACM   0x02

Abstract control management descriptor.

Definition at line 84 of file cdc.h.

◆ USB_CDC_DESCR_SUBTYPE_CALL_MGMT

#define USB_CDC_DESCR_SUBTYPE_CALL_MGMT   0x01

Call management descriptor.

Definition at line 82 of file cdc.h.

◆ USB_CDC_DESCR_SUBTYPE_ETH_NET

#define USB_CDC_DESCR_SUBTYPE_ETH_NET   0x0f

Ethernet descriptor.

Definition at line 86 of file cdc.h.

◆ USB_CDC_DESCR_SUBTYPE_FUNCTIONAL

#define USB_CDC_DESCR_SUBTYPE_FUNCTIONAL   0x00

functional descriptor

Definition at line 80 of file cdc.h.

◆ USB_CDC_DESCR_SUBTYPE_UNION

#define USB_CDC_DESCR_SUBTYPE_UNION   0x06

Union descriptor.

Definition at line 85 of file cdc.h.

◆ USB_CDC_MGNT_NOTIF_AUX_JACK_HOOK_STATE

#define USB_CDC_MGNT_NOTIF_AUX_JACK_HOOK_STATE   0x08

Hook on the auxiliary phone changed notification.

Definition at line 169 of file cdc.h.

◆ USB_CDC_MGNT_NOTIF_CALL_STATE_CHANGE

#define USB_CDC_MGNT_NOTIF_CALL_STATE_CHANGE   0x28

Call state change notification.

Definition at line 184 of file cdc.h.

◆ USB_CDC_MGNT_NOTIF_CONN_SPEED_CHANGE

#define USB_CDC_MGNT_NOTIF_CONN_SPEED_CHANGE   0x2A

Throughput change notification.

Definition at line 194 of file cdc.h.

◆ USB_CDC_MGNT_NOTIF_LINE_STATE_CHANGE

#define USB_CDC_MGNT_NOTIF_LINE_STATE_CHANGE   0x29

Line state change notification.

Definition at line 189 of file cdc.h.

◆ USB_CDC_MGNT_NOTIF_NETWORK_CONNECTION

#define USB_CDC_MGNT_NOTIF_NETWORK_CONNECTION   0x00

Network connection status notification.

Definition at line 159 of file cdc.h.

◆ USB_CDC_MGNT_NOTIF_RESPONSE_AVAILABLE

#define USB_CDC_MGNT_NOTIF_RESPONSE_AVAILABLE   0x01

Response available notification.

Definition at line 164 of file cdc.h.

◆ USB_CDC_MGNT_NOTIF_RING_DETECT

#define USB_CDC_MGNT_NOTIF_RING_DETECT   0x09

Ring voltage on the POTS line interface notification.

Definition at line 174 of file cdc.h.

◆ USB_CDC_MGNT_NOTIF_SERIAL_STATE

#define USB_CDC_MGNT_NOTIF_SERIAL_STATE   0x20

Asynchronous UART status notification.

Definition at line 179 of file cdc.h.

◆ USB_CDC_MGNT_REQUEST_GET_ETH_PM_PATTERN_FILTER

#define USB_CDC_MGNT_REQUEST_GET_ETH_PM_PATTERN_FILTER   0x42

Get ethernet power management pattern filter.

Definition at line 122 of file cdc.h.

◆ USB_CDC_MGNT_REQUEST_GET_ETH_STATISTICS

#define USB_CDC_MGNT_REQUEST_GET_ETH_STATISTICS   0x44

Get ethernet statistics.

Definition at line 132 of file cdc.h.

◆ USB_CDC_MGNT_REQUEST_GET_LINE_CODING

#define USB_CDC_MGNT_REQUEST_GET_LINE_CODING   (0x21)

Request the currently configured line coding.

Definition at line 102 of file cdc.h.

◆ USB_CDC_MGNT_REQUEST_SET_CONTROL_LINE_STATE

#define USB_CDC_MGNT_REQUEST_SET_CONTROL_LINE_STATE   (0x22)

Set the control line state.

Definition at line 107 of file cdc.h.

◆ USB_CDC_MGNT_REQUEST_SET_ETH_MULTICAST_FILTER

#define USB_CDC_MGNT_REQUEST_SET_ETH_MULTICAST_FILTER   0x40

Set ethernet multicast filter request.

Definition at line 112 of file cdc.h.

◆ USB_CDC_MGNT_REQUEST_SET_ETH_PACKET_FILTER

#define USB_CDC_MGNT_REQUEST_SET_ETH_PACKET_FILTER   0x43

Set ethernet packet filter.

Definition at line 127 of file cdc.h.

◆ USB_CDC_MGNT_REQUEST_SET_ETH_PM_PATTERN_FILTER

#define USB_CDC_MGNT_REQUEST_SET_ETH_PM_PATTERN_FILTER   0x41

Set ethernet power management pattern filter.

Definition at line 117 of file cdc.h.

◆ USB_CDC_MGNT_REQUEST_SET_LINE_CODING

#define USB_CDC_MGNT_REQUEST_SET_LINE_CODING   (0x20)

Set line character formatting properties.

Definition at line 97 of file cdc.h.

◆ USB_CDC_PROTOCOL_3GPP

#define USB_CDC_PROTOCOL_3GPP   0x05

AT Commands defined by 3GPP 27.007.

Definition at line 68 of file cdc.h.

◆ USB_CDC_PROTOCOL_CS

#define USB_CDC_PROTOCOL_CS   0x06

AT Commands defined by TIA for CDMA.

Definition at line 69 of file cdc.h.

◆ USB_CDC_PROTOCOL_EEM

#define USB_CDC_PROTOCOL_EEM   0x07

Ethernet Emulation Model.

Definition at line 70 of file cdc.h.

◆ USB_CDC_PROTOCOL_EXT

#define USB_CDC_PROTOCOL_EXT   0xFE

External Protocol.

Definition at line 71 of file cdc.h.

◆ USB_CDC_PROTOCOL_GSM

#define USB_CDC_PROTOCOL_GSM   0x04

AT Commands defined by GSM 07.07.

Definition at line 67 of file cdc.h.

◆ USB_CDC_PROTOCOL_ITU

#define USB_CDC_PROTOCOL_ITU   0x01

AT Commands: V.250 etc.

Definition at line 64 of file cdc.h.

◆ USB_CDC_PROTOCOL_NONE

#define USB_CDC_PROTOCOL_NONE   0x00

No protocol required.

Definition at line 63 of file cdc.h.

◆ USB_CDC_PROTOCOL_PCCA

#define USB_CDC_PROTOCOL_PCCA   0x02

AT Commands defined by PCCA-101.

Definition at line 65 of file cdc.h.

◆ USB_CDC_PROTOCOL_PCCA_A

#define USB_CDC_PROTOCOL_PCCA_A   0x03

AT Commands defined by PCCA-101 & Annex O.

Definition at line 66 of file cdc.h.

◆ USB_CDC_PROTOCOL_VENDOR

#define USB_CDC_PROTOCOL_VENDOR   0xFF

Vendor-specific.

Definition at line 72 of file cdc.h.

◆ USB_CDC_SUBCLASS_ACM

#define USB_CDC_SUBCLASS_ACM   0x02

Abstract Control Model.

Definition at line 45 of file cdc.h.

◆ USB_CDC_SUBCLASS_ANCM

#define USB_CDC_SUBCLASS_ANCM   0x07

ATM Networking Control Model.

Definition at line 50 of file cdc.h.

◆ USB_CDC_SUBCLASS_CCM

#define USB_CDC_SUBCLASS_CCM   0x05

CAPI Control Mode.

Definition at line 48 of file cdc.h.

◆ USB_CDC_SUBCLASS_DLCM

#define USB_CDC_SUBCLASS_DLCM   0x01

Direct Line Control Model.

Definition at line 44 of file cdc.h.

◆ USB_CDC_SUBCLASS_DM

#define USB_CDC_SUBCLASS_DM   0x09

Device Management.

Definition at line 52 of file cdc.h.

◆ USB_CDC_SUBCLASS_EEM

#define USB_CDC_SUBCLASS_EEM   0x0C

Ethernet Emulation Model.

Definition at line 55 of file cdc.h.

◆ USB_CDC_SUBCLASS_ENCM

#define USB_CDC_SUBCLASS_ENCM   0x06

Eth Networking Control Model.

Definition at line 49 of file cdc.h.

◆ USB_CDC_SUBCLASS_MCCM

#define USB_CDC_SUBCLASS_MCCM   0x04

Multi-Channel Control Model.

Definition at line 47 of file cdc.h.

◆ USB_CDC_SUBCLASS_MDLM

#define USB_CDC_SUBCLASS_MDLM   0x0A

Mobile Direct Line Model.

Definition at line 53 of file cdc.h.

◆ USB_CDC_SUBCLASS_NCM

#define USB_CDC_SUBCLASS_NCM   0x0D

Network Control Model.

Definition at line 56 of file cdc.h.

◆ USB_CDC_SUBCLASS_NONE

#define USB_CDC_SUBCLASS_NONE   0x00

No subclass.

Definition at line 43 of file cdc.h.

◆ USB_CDC_SUBCLASS_OBEX

#define USB_CDC_SUBCLASS_OBEX   0x0B

OBEX.

Definition at line 54 of file cdc.h.

◆ USB_CDC_SUBCLASS_TCM

#define USB_CDC_SUBCLASS_TCM   0x03

Telephone Control Model.

Definition at line 46 of file cdc.h.

◆ USB_CDC_SUBCLASS_WHCM

#define USB_CDC_SUBCLASS_WHCM   0x08

Wireless Handset Control Model.

Definition at line 51 of file cdc.h.

◆ USB_CDC_VERSION_BCD

#define USB_CDC_VERSION_BCD   0x0120

USB CDC version in BCD.

Definition at line 36 of file cdc.h.

◆ USB_TYPE_DESCRIPTOR_CDC

#define USB_TYPE_DESCRIPTOR_CDC   0x24

USB CDC type descriptor.

Definition at line 35 of file cdc.h.