00001 /******************************************************************** 00002 FileName: usb_config.h 00003 Dependencies: Always: GenericTypeDefs.h, usb_device.h 00004 Situational: usb_function_hid.h, usb_function_cdc.h, usb_function_msd.h, etc. 00005 Processor: PIC18 or PIC24 USB Microcontrollers 00006 Hardware: The code is natively intended to be used on the following 00007 hardware platforms: PICDEM FS USB Demo Board, 00008 PIC18F87J50 FS USB Plug-In Module, or 00009 Explorer 16 + PIC24 USB PIM. The firmware may be 00010 modified for use on other USB platforms by editing the 00011 HardwareProfile.h file. 00012 Complier: Microchip C18 (for PIC18) or C30 (for PIC24) 00013 Company: Microchip Technology, Inc. 00014 00015 Software License Agreement: 00016 00017 The software supplied herewith by Microchip Technology Incorporated 00018 (the Company) for its PICŽ Microcontroller is intended and 00019 supplied to you, the Companys customer, for use solely and 00020 exclusively on Microchip PIC Microcontroller products. The 00021 software is owned by the Company and/or its supplier, and is 00022 protected under applicable copyright laws. All rights are reserved. 00023 Any use in violation of the foregoing restrictions may subject the 00024 user to criminal sanctions under applicable laws, as well as to 00025 civil liability for the breach of the terms and conditions of this 00026 license. 00027 00028 THIS SOFTWARE IS PROVIDED IN AN AS IS CONDITION. NO WARRANTIES, 00029 WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED 00030 TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00031 PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, 00032 IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR 00033 CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. 00034 00035 ******************************************************************** 00036 File Description: 00037 00038 Change History: 00039 Rev Date Description 00040 1.0 11/19/2004 Initial release 00041 2.1 02/26/2007 Updated for simplicity and to use common 00042 coding style 00043 2.1p 03/11/2010 Adopted for the PICCOLO project - I. Cserny 00044 *******************************************************************/ 00045 00046 /********************************************************************* 00047 * Descriptor specific type definitions are defined in: usbd.h 00048 ********************************************************************/ 00049 00050 #ifndef USBCFG_H 00051 #define USBCFG_H 00052 00053 #include "piccolo_config.h" 00054 00056 #define USB_EP0_BUFF_SIZE 8 // Valid Options: 8, 16, 32, or 64 bytes. 00057 // Using larger options take more SRAM, but 00058 // does not provide much advantage in most types 00059 // of applications. Exceptions to this, are applications 00060 // that use EP0 IN or OUT for sending large amounts of 00061 // application related data. 00062 00063 #define USB_MAX_NUM_INT 1 // For tracking Alternate Setting 00064 00065 //Device descriptor - if these two definitions are not defined then 00066 // a ROM USB_DEVICE_DESCRIPTOR variable by the exact name of device_dsc 00067 // must exist. 00068 #define USB_USER_DEVICE_DESCRIPTOR &device_dsc 00069 #define USB_USER_DEVICE_DESCRIPTOR_INCLUDE extern ROM USB_DEVICE_DESCRIPTOR device_dsc 00070 00071 //Configuration descriptors - if these two definitions do not exist then 00072 // a ROM BYTE *ROM variable named exactly USB_CD_Ptr[] must exist. 00073 #define USB_USER_CONFIG_DESCRIPTOR USB_CD_Ptr 00074 #define USB_USER_CONFIG_DESCRIPTOR_INCLUDE extern ROM BYTE *ROM USB_CD_Ptr[] 00075 00076 //Make sure only one of the below "#define USB_PING_PONG_MODE" 00077 //is uncommented. 00078 //#define USB_PING_PONG_MODE USB_PING_PONG__NO_PING_PONG 00079 #define USB_PING_PONG_MODE USB_PING_PONG__FULL_PING_PONG 00080 //#define USB_PING_PONG_MODE USB_PING_PONG__EP0_OUT_ONLY 00081 //#define USB_PING_PONG_MODE USB_PING_PONG__ALL_BUT_EP0 //NOTE: This mode is not supported in PIC18F4550 family rev A3 devices 00082 00083 //-- Automatically select between polling/interrupt mode 00084 //-- depending on the definition of symbol USE_INTERRUPT 00085 #if defined(USE_INTERRUPT) 00086 #define USB_INTERRUPT 00087 #else 00088 #define USB_POLLING 00089 #endif 00090 00091 //-- Define priority of the USB Interrupt (0:low, 1:high) 00092 #define USB_ISR_PRIORITY 1 00093 00094 /* Parameter definitions are defined in usb_device.h */ 00095 #define USB_PULLUP_OPTION USB_PULLUP_ENABLE 00096 //#define USB_PULLUP_OPTION USB_PULLUP_DISABLED 00097 00098 #define USB_TRANSCEIVER_OPTION USB_INTERNAL_TRANSCEIVER 00099 //External Transceiver support is not available on all product families. Please 00100 // refer to the product family datasheet for more information if this feature 00101 // is available on the target processor. 00102 //#define USB_TRANSCEIVER_OPTION USB_EXTERNAL_TRANSCEIVER 00103 00104 #define USB_SPEED_OPTION USB_FULL_SPEED 00105 //#define USB_SPEED_OPTION USB_LOW_SPEED //(not valid option for PIC24F devices) 00106 00107 #define USB_SUPPORT_DEVICE 00108 00109 #define USB_NUM_STRING_DESCRIPTORS 3 00110 00111 //#define USB_INTERRUPT_LEGACY_CALLBACKS 00112 #define USB_ENABLE_ALL_HANDLERS 00113 //#define USB_ENABLE_SUSPEND_HANDLER 00114 //#define USB_ENABLE_WAKEUP_FROM_SUSPEND_HANDLER 00115 //#define USB_ENABLE_SOF_HANDLER 00116 //#define USB_ENABLE_ERROR_HANDLER 00117 //#define USB_ENABLE_OTHER_REQUEST_HANDLER 00118 //#define USB_ENABLE_SET_DESCRIPTOR_HANDLER 00119 //#define USB_ENABLE_INIT_EP_HANDLER 00120 //#define USB_ENABLE_EP0_DATA_HANDLER 00121 //#define USB_ENABLE_TRANSFER_COMPLETE_HANDLER 00122 00124 #define USB_USE_CDC 00125 00127 #define USB_MAX_EP_NUMBER 3 00128 00129 /* CDC */ 00130 #define CDC_COMM_INTF_ID 0x0 00131 #define CDC_COMM_EP 2 00132 #define CDC_COMM_IN_EP_SIZE 8 00133 00134 #define CDC_DATA_INTF_ID 0x01 00135 #define CDC_DATA_EP 3 00136 #define CDC_DATA_OUT_EP_SIZE 64 00137 #define CDC_DATA_IN_EP_SIZE 64 00138 00139 //#define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D2 //Send_Break command 00140 #define USB_CDC_SUPPORT_ABSTRACT_CONTROL_MANAGEMENT_CAPABILITIES_D1 //Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and Serial_State commands 00141 00143 #endif //USBCFG_H