1 /*********************************************************************
3 * Microchip USB C18 Firmware Version 1.0
5 *********************************************************************
7 * Dependencies: See INCLUDES section below
9 * Compiler: C18 2.30.01+
10 * Company: Microchip Technology, Inc.
12 * Software License Agreement
14 * The software supplied herewith by Microchip Technology Incorporated
15 * (the “Company”) for its PICmicro® Microcontroller is intended and
16 * supplied to you, the Company’s customer, for use solely and
17 * exclusively on Microchip PICmicro Microcontroller products. The
18 * software is owned by the Company and/or its supplier, and is
19 * protected under applicable copyright laws. All rights are reserved.
20 * Any use in violation of the foregoing restrictions may subject the
21 * user to criminal sanctions under applicable laws, as well as to
22 * civil liability for the breach of the terms and conditions of this
25 * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
26 * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
27 * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
28 * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
29 * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
30 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
32 ********************************************************************/
37 /** D E F I N I T I O N S *******************************************/
38 #define EP0_BUFF_SIZE 8 // 8, 16, 32, or 64
39 #define MAX_NUM_INT 1 // For tracking Alternate Setting
41 /* Parameter definitions are defined in usbdrv.h */
42 #define MODE_PP _PPBM0
43 #define UCFG_VAL _PUEN|_TRINT|_FS|MODE_PP
45 //#define USE_SELF_POWER_SENSE_IO
46 //#define USE_USB_BUS_SENSE_IO
48 /** D E V I C E C L A S S U S A G E *******************************/
52 * MUID = Microchip USB Class ID
53 * Used to identify which of the USB classes owns the current
54 * session of control transfer over EP0
62 /** E N D P O I N T S A L L O C A T I O N **************************/
64 * See usbmmap.c for an explanation of how the endpoint allocation works
68 #define CDC_COMM_INTF_ID 0x00
69 #define CDC_COMM_UEP UEP2
70 #define CDC_INT_BD_IN ep2Bi
71 #define CDC_INT_EP_SIZE 8
73 #define CDC_DATA_INTF_ID 0x01
74 #define CDC_DATA_UEP UEP3
75 #define CDC_BULK_BD_OUT ep3Bo
76 #define CDC_BULK_OUT_EP_SIZE 64
77 #define CDC_BULK_BD_IN ep3Bi
78 #define CDC_BULK_IN_EP_SIZE 64
80 #define MAX_EP_NUMBER 3 // UEP3