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