usb_config.h

Microchip USB Device Library

USB Device Library Help
usb_config.h

usb_config.h is a file used to configure the MCHPFSUSB stack and various function drivers. This file provides compile time selection of options provided by the stack. This file defines constants needed by the stack and various function drivers. 

This section will detail the definitions required by the CDC function driver. Additional definitions may be required by the stack itself. Please see the Files topic of the Stack section for more details about stack specific definitions. 

Please note that the usb_config.h file can also be generated using the USBConfig.exe tool provided in the "<Install Directory>\USB Tools\USBConfig Tool" directory. 

USB_USE_CDC - this definitions indicates to the stack that it will be using the CDC function driver. This needs to be defined for any device using the CDC class. 

#define USB_USE_CDC 

CDC_COMM_INTF_ID - this defines the interface number of the communication interface used by the CDC function driver. This number should be unique from other interface numbers used in the device for either this class or any other class. 

#define CDC_COMM_INTF_ID 0x00 

CDC_COMM_EP - this defines the endpoint number of the communication interface used by the CDC function driver. This number should be unique from other endpoint numbers used in the device for either this class or any other class. The valid range for this entry is 1-15. 

#define CDC_COMM_EP 2 

CDC_COMM_IN_EP_SIZE - this defines the size of the communication endpoint used by the CDC function driver's communication interface. The current CDC specification only uses 8-byte packets on this endpoint so at this point of time this value should be 8. 

CDC_DATA_INTF_ID - this defines the interface number of the data interface used by the CDC function driver. This number should be unique from other interface numbers used in the device for either this class or any other class. 

#define CDC_DATA_INTF_ID 0x01 

CDC_DATA_EP - this defines the endpoint number of the data interface used by the CDC function driver. This number should be unique from other endpoint numbers used in the device for either this class or any other class. The valid range for this entry is 1-15. 

#define CDC_DATA_EP 3 

CDC_DATA_OUT_EP_SIZE - this defines the size of the data OUT endpoint used by the CDC function driver's data interface. 

#define CDC_DATA_OUT_EP_SIZE 64 

CDC_DATA_IN_EP_SIZE - this defines the size of the data IN endpoint used by the CDC function driver's data interface. 

#define CDC_DATA_IN_EP_SIZE 64 

USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D1 - this define tells the CDC function driver to support ACM capabilities D1 (the Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and Serial_State commands). For more details please refer to section 5.2.3.3 of the CDC specification (usbcdc11.pdf) available from www.usb.org. Create this definition if these options are desired. 

#define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D1 

USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D2 - this define tells the CDC function driver to support ACM capabilities D2 (the SEND_BREAK command). For more details please refer to section 5.2.3.3 of the CDC specification (usbcdc11.pdf) available from www.usb.org. Create this definition if these options are desired. 

#define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D2 

USB_CDC_SUPPORT_HARDWARE_FLOW_CONTROL - this define tells the CDC function driver to implement hardware flow control and UART features. This feature is optional and should only be defined for applications that want this feature. Additional definitions are required in HardwareProfiles.h if this definition is enabled. Please see the HardwareProfiles.h topic in the CDC function driver for more details about those definitions. 

#define USB_CDC_SUPPORT_HARDWARE_FLOW_CONTROL 

USB_CDC_SET_LINE_CODING_HANDLER - this define tells the CDC function driver which function to call when a set line coding command is received. This function can be used to verify that the line coding is within a supported range and can set the hardware according to the specified settings. If this definition is not defined then no function is called when a set line coding is received and the device will defaulting respond to the host with a successful update of the line coding parameters. 

#define USB_CDC_SET_LINE_CODING_HANDLER mySetLineCodingHandler 

Microchip MCHPFSUSB v2.3 - Sept 20, 2008
Copyright © 2008 Microchip Technology, Inc.  All rights reserved.