Rev 1661 Rev 1711
1 /******************************************************************** 1 /********************************************************************
2 FileName: usb_config.h 2 FileName: usb_config.h
3 Dependencies: Always: GenericTypeDefs.h, usb_device.h 3 Dependencies: Always: GenericTypeDefs.h, usb_device.h
4 Situational: usb_function_hid.h, usb_function_cdc.h, usb_function_msd.h, etc. 4 Situational: usb_function_hid.h, usb_function_cdc.h, usb_function_msd.h, etc.
5 Processor: PIC18 or PIC24 USB Microcontrollers 5 Processor: PIC18 or PIC24 USB Microcontrollers
6 Hardware: The code is natively intended to be used on the following 6 Hardware: The code is natively intended to be used on the following
7 hardware platforms: PICDEM™ FS USB Demo Board, 7 hardware platforms: PICDEM™ FS USB Demo Board,
8 PIC18F87J50 FS USB Plug-In Module, or 8 PIC18F87J50 FS USB Plug-In Module, or
9 Explorer 16 + PIC24 USB PIM. The firmware may be 9 Explorer 16 + PIC24 USB PIM. The firmware may be
10 modified for use on other USB platforms by editing the 10 modified for use on other USB platforms by editing the
11 HardwareProfile.h file. 11 HardwareProfile.h file.
12 Complier: Microchip C18 (for PIC18) or C30 (for PIC24) 12 Complier: Microchip C18 (for PIC18) or C30 (for PIC24)
13 Company: Microchip Technology, Inc. 13 Company: Microchip Technology, Inc.
14   14  
15 Software License Agreement: 15 Software License Agreement:
16   16  
17 The software supplied herewith by Microchip Technology Incorporated 17 The software supplied herewith by Microchip Technology Incorporated
18 (the “Company”) for its PIC® Microcontroller is intended and 18 (the “Company”) for its PIC® Microcontroller is intended and
19 supplied to you, the Company’s customer, for use solely and 19 supplied to you, the Company’s customer, for use solely and
20 exclusively on Microchip PIC Microcontroller products. The 20 exclusively on Microchip PIC Microcontroller products. The
21 software is owned by the Company and/or its supplier, and is 21 software is owned by the Company and/or its supplier, and is
22 protected under applicable copyright laws. All rights are reserved. 22 protected under applicable copyright laws. All rights are reserved.
23 Any use in violation of the foregoing restrictions may subject the 23 Any use in violation of the foregoing restrictions may subject the
24 user to criminal sanctions under applicable laws, as well as to 24 user to criminal sanctions under applicable laws, as well as to
25 civil liability for the breach of the terms and conditions of this 25 civil liability for the breach of the terms and conditions of this
26 license. 26 license.
27   27  
28 THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, 28 THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
29 WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED 29 WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
30 TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 30 TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
31 PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, 31 PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
32 IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR 32 IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
33 CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. 33 CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
34   34  
35 ******************************************************************** 35 ********************************************************************
36 File Description: 36 File Description:
37   37  
38 Change History: 38 Change History:
39 Rev Date Description 39 Rev Date Description
40 1.0 11/19/2004 Initial release 40 1.0 11/19/2004 Initial release
41 2.1 02/26/2007 Updated for simplicity and to use common 41 2.1 02/26/2007 Updated for simplicity and to use common
42 coding style 42 coding style
43 *******************************************************************/ 43 *******************************************************************/
44   44  
45 /********************************************************************* 45 /*********************************************************************
46 * Descriptor specific type definitions are defined in: usbd.h 46 * Descriptor specific type definitions are defined in: usbd.h
47 ********************************************************************/ 47 ********************************************************************/
48   48  
49 #ifndef USBCFG_H 49 #ifndef USBCFG_H
50 #define USBCFG_H 50 #define USBCFG_H
51   51  
52 /** DEFINITIONS ****************************************************/ 52 /** DEFINITIONS ****************************************************/
53 #define USB_EP0_BUFF_SIZE 8 // Valid Options: 8, 16, 32, or 64 bytes. 53 #define USB_EP0_BUFF_SIZE 8 // Valid Options: 8, 16, 32, or 64 bytes.
54 // Using larger options take more SRAM, but 54 // Using larger options take more SRAM, but
55 // does not provide much advantage in most types 55 // does not provide much advantage in most types
56 // of applications. Exceptions to this, are applications 56 // of applications. Exceptions to this, are applications
57 // that use EP0 IN or OUT for sending large amounts of 57 // that use EP0 IN or OUT for sending large amounts of
58 // application related data. 58 // application related data.
59 59
60 #define USB_MAX_NUM_INT 1 // For tracking Alternate Setting 60 #define USB_MAX_NUM_INT 1 // For tracking Alternate Setting
61 #define USB_MAX_EP_NUMBER 1 61 #define USB_MAX_EP_NUMBER 1
62   62  
63 //Device descriptor - if these two definitions are not defined then 63 //Device descriptor - if these two definitions are not defined then
64 // a ROM USB_DEVICE_DESCRIPTOR variable by the exact name of device_dsc 64 // a ROM USB_DEVICE_DESCRIPTOR variable by the exact name of device_dsc
65 // must exist. 65 // must exist.
66 #define USB_USER_DEVICE_DESCRIPTOR &device_dsc 66 #define USB_USER_DEVICE_DESCRIPTOR &device_dsc
67 #define USB_USER_DEVICE_DESCRIPTOR_INCLUDE extern ROM USB_DEVICE_DESCRIPTOR device_dsc 67 #define USB_USER_DEVICE_DESCRIPTOR_INCLUDE extern ROM USB_DEVICE_DESCRIPTOR device_dsc
68   68  
69 //Configuration descriptors - if these two definitions do not exist then 69 //Configuration descriptors - if these two definitions do not exist then
70 // a ROM BYTE *ROM variable named exactly USB_CD_Ptr[] must exist. 70 // a ROM BYTE *ROM variable named exactly USB_CD_Ptr[] must exist.
71 #define USB_USER_CONFIG_DESCRIPTOR USB_CD_Ptr 71 #define USB_USER_CONFIG_DESCRIPTOR USB_CD_Ptr
72 #define USB_USER_CONFIG_DESCRIPTOR_INCLUDE extern ROM BYTE *ROM USB_CD_Ptr[] 72 #define USB_USER_CONFIG_DESCRIPTOR_INCLUDE extern ROM BYTE *ROM USB_CD_Ptr[]
73   73  
74 //Make sure only one of the below "#define USB_PING_PONG_MODE" 74 //Make sure only one of the below "#define USB_PING_PONG_MODE"
75 //is uncommented. 75 //is uncommented.
76 //#define USB_PING_PONG_MODE USB_PING_PONG__NO_PING_PONG 76 //#define USB_PING_PONG_MODE USB_PING_PONG__NO_PING_PONG
77 #define USB_PING_PONG_MODE USB_PING_PONG__FULL_PING_PONG 77 #define USB_PING_PONG_MODE USB_PING_PONG__FULL_PING_PONG
78 //#define USB_PING_PONG_MODE USB_PING_PONG__EP0_OUT_ONLY 78 //#define USB_PING_PONG_MODE USB_PING_PONG__EP0_OUT_ONLY
79 //#define USB_PING_PONG_MODE USB_PING_PONG__ALL_BUT_EP0 //NOTE: This mode is not supported in PIC18F4550 family rev A3 devices 79 //#define USB_PING_PONG_MODE USB_PING_PONG__ALL_BUT_EP0 //NOTE: This mode is not supported in PIC18F4550 family rev A3 devices
80   80  
81   81  
82 #define USB_POLLING 82 #define USB_POLLING
83 //#define USB_INTERRUPT 83 //#define USB_INTERRUPT
84   84  
85 /* Parameter definitions are defined in usb_device.h */ 85 /* Parameter definitions are defined in usb_device.h */
86 #define USB_PULLUP_OPTION USB_PULLUP_ENABLE 86 #define USB_PULLUP_OPTION USB_PULLUP_ENABLE
87 //#define USB_PULLUP_OPTION USB_PULLUP_DISABLED 87 //#define USB_PULLUP_OPTION USB_PULLUP_DISABLED
88   88  
89 #define USB_TRANSCEIVER_OPTION USB_INTERNAL_TRANSCEIVER 89 #define USB_TRANSCEIVER_OPTION USB_INTERNAL_TRANSCEIVER
90 //External Transceiver support is not available on all product families. Please 90 //External Transceiver support is not available on all product families. Please
91 // refer to the product family datasheet for more information if this feature 91 // refer to the product family datasheet for more information if this feature
92 // is available on the target processor. 92 // is available on the target processor.
93 //#define USB_TRANSCEIVER_OPTION USB_EXTERNAL_TRANSCEIVER 93 //#define USB_TRANSCEIVER_OPTION USB_EXTERNAL_TRANSCEIVER
94   94  
95 #define USB_SPEED_OPTION USB_FULL_SPEED 95 #define USB_SPEED_OPTION USB_FULL_SPEED
96 //#define USB_SPEED_OPTION USB_LOW_SPEED //(not valid option for PIC24F devices) 96 //#define USB_SPEED_OPTION USB_LOW_SPEED //(not valid option for PIC24F devices)
97   97  
98 #define USB_SUPPORT_DEVICE 98 #define USB_SUPPORT_DEVICE
99   99  
100 #define USB_NUM_STRING_DESCRIPTORS 4 100 #define USB_NUM_STRING_DESCRIPTORS 4
101   101  
102 //#define USB_INTERRUPT_LEGACY_CALLBACKS 102 //#define USB_INTERRUPT_LEGACY_CALLBACKS
103 #define USB_ENABLE_ALL_HANDLERS 103 #define USB_ENABLE_ALL_HANDLERS
104 //#define USB_ENABLE_SUSPEND_HANDLER 104 //#define USB_ENABLE_SUSPEND_HANDLER
105 //#define USB_ENABLE_WAKEUP_FROM_SUSPEND_HANDLER 105 //#define USB_ENABLE_WAKEUP_FROM_SUSPEND_HANDLER
106 //#define USB_ENABLE_SOF_HANDLER 106 //#define USB_ENABLE_SOF_HANDLER
107 //#define USB_ENABLE_ERROR_HANDLER 107 //#define USB_ENABLE_ERROR_HANDLER
108 //#define USB_ENABLE_OTHER_REQUEST_HANDLER 108 //#define USB_ENABLE_OTHER_REQUEST_HANDLER
109 //#define USB_ENABLE_SET_DESCRIPTOR_HANDLER 109 //#define USB_ENABLE_SET_DESCRIPTOR_HANDLER
110 //#define USB_ENABLE_INIT_EP_HANDLER 110 //#define USB_ENABLE_INIT_EP_HANDLER
111 //#define USB_ENABLE_EP0_DATA_HANDLER 111 //#define USB_ENABLE_EP0_DATA_HANDLER
112 //#define USB_ENABLE_TRANSFER_COMPLETE_HANDLER 112 //#define USB_ENABLE_TRANSFER_COMPLETE_HANDLER
113   113  
114 /** DEVICE CLASS USAGE *********************************************/ 114 /** DEVICE CLASS USAGE *********************************************/
115 #define USB_USE_GEN 115 #define USB_USE_GEN
116   116  
117 /** ENDPOINTS ALLOCATION *******************************************/ 117 /** ENDPOINTS ALLOCATION *******************************************/
118   118  
119 /* Generic */ 119 /* Generic */
120 #define USBGEN_EP_SIZE 64 120 #define USBGEN_EP_SIZE 64
121 #define USBGEN_EP_NUM 1 121 #define USBGEN_EP_NUM 1
122   122  
123 /** DEFINITIONS ****************************************************/ 123 /** DEFINITIONS ****************************************************/
124   124  
125 #endif //USBCFG_H 125 #endif //USBCFG_H