nRF5 SDK v17.1.0
Macros
CDC class descriptors

nRF52840 only: Descriptors used in the USB CDC class implementation.A group of macros used to initialize CDC descriptors More...

Macros

#define APP_USBD_CDC_IAD_DSC(interface_number, subclass, protocol)
 Initializer of IAD descriptor for CDC class. More...
 
#define APP_USBD_CDC_COMM_INTERFACE_DSC(interface_number, subclass, protocol)
 Initializer of interface descriptor for CDC COMM class. More...
 
#define APP_USBD_CDC_DATA_INTERFACE_DSC(interface_number, subclass, protocol)
 Initializer of interface descriptor for CDC DATA class. More...
 
#define APP_USBD_CDC_COM_EP_DSC(endpoint_in, ep_size)
 Initializer of endpoint descriptor for CDC COM class. More...
 
#define APP_USBD_CDC_DATA_EP_DSC(endpoint_in, endpoint_out, ep_size)
 Initializer of endpoint descriptors for CDC DATA class. More...
 
#define APP_USBD_CDC_HEADER_DSC(bcd_cdc)
 Initializer of endpoint descriptors for CDC header descriptor. More...
 
#define APP_USBD_CDC_CALL_MGMT_DSC(capabilities, data_interface)
 Initializer of endpoint descriptors for CDC call management descriptor. More...
 
#define APP_USBD_CDC_ACM_DSC(capabilities)
 Initializer of endpoint descriptors for CDC DATA class. More...
 
#define APP_USBD_CDC_UNION_DSC(control_interface,...)
 Initializer of endpoint descriptors for CDC DATA class. More...
 

Detailed Description

nRF52840 only: Descriptors used in the USB CDC class implementation.

A group of macros used to initialize CDC descriptors

Macro Definition Documentation

#define APP_USBD_CDC_ACM_DSC (   capabilities)
Value:
/*.bLength = */ sizeof(app_usbd_cdc_desc_acm_t), \
/*.bDescriptorType = */ APP_USBD_CDC_CS_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_CDC_SCS_ACM, \
/*.bmCapabilities = */ capabilities, \

Initializer of endpoint descriptors for CDC DATA class.

Parameters
capabilitiesCapabilities.
#define APP_USBD_CDC_CALL_MGMT_DSC (   capabilities,
  data_interface 
)
Value:
/*.bLength = */ sizeof(app_usbd_cdc_desc_call_mgmt_t), \
/*.bDescriptorType = */ APP_USBD_CDC_CS_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_CDC_SCS_CALL_MGMT, \
/*.bmCapabilities = */ capabilities, \
/*.bDataInterface = */ data_interface, \

Initializer of endpoint descriptors for CDC call management descriptor.

Parameters
capabilitiesCapabilities.
data_interfaceData interface.
#define APP_USBD_CDC_COM_EP_DSC (   endpoint_in,
  ep_size 
)
Value:
/*.bLength = */ sizeof(app_usbd_descriptor_ep_t), \
/*.bDescriptorType = */ APP_USBD_DESCRIPTOR_ENDPOINT, \
/*.bEndpointAddress = */ endpoint_in, \
/*.bmAttributes = */ APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_INTERRUPT, \
/*.wMaxPacketSize = */ APP_USBD_U16_TO_RAW_DSC(ep_size), \
/*.bInterval = */ 16, \

Initializer of endpoint descriptor for CDC COM class.

Parameters
endpoint_inIN endpoint.
ep_sizeEndpoint size.
#define APP_USBD_CDC_COMM_INTERFACE_DSC (   interface_number,
  subclass,
  protocol 
)
Value:
/*.bLength = */ sizeof(app_usbd_descriptor_iface_t), \
/*.bDescriptorType = */ APP_USBD_DESCRIPTOR_INTERFACE, \
/*.bInterfaceNumber = */ interface_number, \
/*.bAlternateSetting = */ 0x00, \
/*.bNumEndpoints = */ 1, \
/*.bInterfaceClass = */ APP_USBD_CDC_COMM_CLASS, \
/*.bInterfaceSubClass = */ subclass, \
/*.bInterfaceProtocol = */ protocol, \
/*.iInterface = 0, */ 0x00, \

Initializer of interface descriptor for CDC COMM class.

Parameters
interface_numberInterface number.
subclassSubclass, app_usbd_cdc_subclass_t.
protocolProtocol, app_usbd_cdc_comm_protocol_t.
#define APP_USBD_CDC_DATA_EP_DSC (   endpoint_in,
  endpoint_out,
  ep_size 
)
Value:
/*.bLength = */ sizeof(app_usbd_descriptor_ep_t), \
/*.bDescriptorType = */ APP_USBD_DESCRIPTOR_ENDPOINT, \
/*.bEndpointAddress = */ endpoint_in, \
/*.bmAttributes = */ APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_BULK, \
/*.wMaxPacketSize = */ APP_USBD_U16_TO_RAW_DSC(ep_size), \
/*.bInterval = */ 0, \
/*.bLength = */ sizeof(app_usbd_descriptor_ep_t), \
/*.bDescriptorType = */ APP_USBD_DESCRIPTOR_ENDPOINT, \
/*.bEndpointAddress = */ endpoint_out, \
/*.bmAttributes = */ APP_USBD_DESCRIPTOR_EP_ATTR_TYPE_BULK, \
/*.wMaxPacketSize = */ APP_USBD_U16_TO_RAW_DSC(ep_size), \
/*.bInterval = */ 0, \

Initializer of endpoint descriptors for CDC DATA class.

Parameters
endpoint_inIN endpoint.
endpoint_outOUT endpoint.
ep_sizeEndpoint size.
#define APP_USBD_CDC_DATA_INTERFACE_DSC (   interface_number,
  subclass,
  protocol 
)
Value:
/*.bLength = */ sizeof(app_usbd_descriptor_iface_t), \
/*.bDescriptorType = */ APP_USBD_DESCRIPTOR_INTERFACE, \
/*.bInterfaceNumber = */ interface_number, \
/*.bAlternateSetting = */ 0x00, \
/*.bNumEndpoints = */ 2, \
/*.bInterfaceClass = */ APP_USBD_CDC_DATA_CLASS, \
/*.bInterfaceSubClass = */ subclass, \
/*.bInterfaceProtocol = */ protocol, \
/*.iInterface = 0, */ 0x00, \

Initializer of interface descriptor for CDC DATA class.

Parameters
interface_numberInterface number.
subclassSubclass, app_usbd_cdc_subclass_t.
protocolProtocol, app_usbd_cdc_data_protocol_t.
#define APP_USBD_CDC_HEADER_DSC (   bcd_cdc)
Value:
/*.bLength = */ sizeof(app_usbd_cdc_desc_header_t), \
/*.bDescriptorType = */ APP_USBD_CDC_CS_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_CDC_SCS_HEADER, \
/*.bcdCDC = */ APP_USBD_U16_TO_RAW_DSC(bcd_cdc), \

Initializer of endpoint descriptors for CDC header descriptor.

Parameters
bcd_cdcBCD CDC version.
#define APP_USBD_CDC_IAD_DSC (   interface_number,
  subclass,
  protocol 
)
Value:
/*.bLength = */ sizeof(app_usbd_descriptor_iad_t), \
/*.bDescriptorType = */ APP_USBD_DESCRIPTOR_INTERFACE_ASSOCIATION, \
/*.bFirstInterface = */ interface_number, \
/*.bInterfaceCount = */ 2, \
/*.bFunctionClass = */ APP_USBD_CDC_COMM_CLASS, \
/*.bFunctionSubClass = */ subclass, \
/*.bFunctionProtocol = */ protocol, \
/*.iFunction = */ 0, \

Initializer of IAD descriptor for CDC class.

Parameters
interface_numberInterface number.
subclassSubclass, app_usbd_cdc_subclass_t.
protocolProtocol, app_usbd_cdc_comm_protocol_t.
#define APP_USBD_CDC_UNION_DSC (   control_interface,
  ... 
)
Value:
/*.bLength = */ sizeof(app_usbd_cdc_desc_union_t) + (NUM_VA_ARGS(__VA_ARGS__)), \
/*.bDescriptorType = */ APP_USBD_CDC_CS_INTERFACE, \
/*.bDescriptorSubtype = */ APP_USBD_CDC_SCS_UNION, \
/*.bControlInterface = */ control_interface, \
/*.bSubordinateInterface = */ __VA_ARGS__, \

Initializer of endpoint descriptors for CDC DATA class.

Parameters
control_interfaceControl interface.
...Subordinate interfaces list.

Documentation feedback | Developer Zone | Subscribe | Updated