Microchip® Advanced Software Framework

services/usb/class/cdc/device/example2/conf_usb.h File Reference

USB configuration file for CDC application.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "compiler.h"
#include "udi_cdc_conf.h"
#include "uart.h"
#include "main.h"

Macros

#define USB_DEVICE_VENDOR_ID   USB_VID_ATMEL
 USB Device Configuration. More...
 
#define USB_DEVICE_PRODUCT_ID   USB_PID_ATMEL_ASF_TWO_CDC
 
#define USB_DEVICE_MAJOR_VERSION   1
 
#define USB_DEVICE_MINOR_VERSION   0
 
#define USB_DEVICE_POWER   100
 
#define USB_DEVICE_ATTR   (USB_CONFIG_ATTR_SELF_POWERED)
 
#define USB_DEVICE_MANUFACTURE_NAME   "ATMEL ASF"
 USB Device string definitions (Optional) More...
 
#define USB_DEVICE_PRODUCT_NAME   "CDC Virtual Com"
 
#define UDC_VBUS_EVENT(b_vbus_high)
 Device speeds support Low speed not supported by CDC. More...
 
#define UDC_SOF_EVENT()   main_sof_action()
 
#define UDC_SUSPEND_EVENT()   main_suspend_action()
 
#define UDC_RESUME_EVENT()   main_resume_action()
 
#define UDI_CDC_PORT_NB   2
 Mandatory when USB_DEVICE_ATTR authorizes remote wakeup feature. More...
 
#define UDI_CDC_ENABLE_EXT(port)   main_cdc_enable(port)
 Interface callback definition. More...
 
#define UDI_CDC_DISABLE_EXT(port)   main_cdc_disable(port)
 
#define UDI_CDC_RX_NOTIFY(port)   uart_rx_notify(port)
 
#define UDI_CDC_TX_EMPTY_NOTIFY(port)
 
#define UDI_CDC_SET_CODING_EXT(port, cfg)   uart_config(port,cfg)
 
#define UDI_CDC_SET_DTR_EXT(port, set)   main_cdc_set_dtr(port,set)
 
#define UDI_CDC_SET_RTS_EXT(port, set)
 
#define UDI_CDC_LOW_RATE
 Define it when the transfer CDC Device to Host is a low rate (<512000 bauds) to reduce CDC buffers size. More...
 
#define UDI_CDC_DEFAULT_RATE   115200
 Default configuration of communication port. More...
 
#define UDI_CDC_DEFAULT_STOPBITS   CDC_STOP_BITS_1
 
#define UDI_CDC_DEFAULT_PARITY   CDC_PAR_NONE
 
#define UDI_CDC_DEFAULT_DATABITS   8
 

#define UDC_RESUME_EVENT ( )    main_resume_action()
#define UDC_SOF_EVENT ( )    main_sof_action()
#define UDC_SUSPEND_EVENT ( )    main_suspend_action()
#define UDC_VBUS_EVENT (   b_vbus_high)

Device speeds support Low speed not supported by CDC.

To authorize the High speed USB Device Callbacks definitions (Optional)

#define UDI_CDC_DEFAULT_DATABITS   8
#define UDI_CDC_DEFAULT_PARITY   CDC_PAR_NONE
#define UDI_CDC_DEFAULT_RATE   115200

Default configuration of communication port.

#define UDI_CDC_DEFAULT_STOPBITS   CDC_STOP_BITS_1
#define UDI_CDC_DISABLE_EXT (   port)    main_cdc_disable(port)
#define UDI_CDC_ENABLE_EXT (   port)    main_cdc_enable(port)

Interface callback definition.

#define UDI_CDC_LOW_RATE

Define it when the transfer CDC Device to Host is a low rate (<512000 bauds) to reduce CDC buffers size.

#define UDI_CDC_PORT_NB   2

Mandatory when USB_DEVICE_ATTR authorizes remote wakeup feature.

When a extra string descriptor must be supported other than manufacturer, product and serial string USB Device low level configuration For device that does not use default settings, e.g., number of banks for each bulk endpoint (default is 2). USB Interface Configuration Configuration of CDC interfaceDefine two USB communication ports

#define UDI_CDC_RX_NOTIFY (   port)    uart_rx_notify(port)
#define UDI_CDC_SET_CODING_EXT (   port,
  cfg 
)    uart_config(port,cfg)
#define UDI_CDC_SET_DTR_EXT (   port,
  set 
)    main_cdc_set_dtr(port,set)
#define UDI_CDC_SET_RTS_EXT (   port,
  set 
)
#define UDI_CDC_TX_EMPTY_NOTIFY (   port)
#define USB_DEVICE_ATTR   (USB_CONFIG_ATTR_SELF_POWERED)
#define USB_DEVICE_MAJOR_VERSION   1
#define USB_DEVICE_MANUFACTURE_NAME   "ATMEL ASF"

USB Device string definitions (Optional)

#define USB_DEVICE_MINOR_VERSION   0
#define USB_DEVICE_POWER   100
#define USB_DEVICE_PRODUCT_ID   USB_PID_ATMEL_ASF_TWO_CDC
#define USB_DEVICE_PRODUCT_NAME   "CDC Virtual Com"
#define USB_DEVICE_VENDOR_ID   USB_VID_ATMEL

USB Device Configuration.

Device definition (mandatory)