/********************************************************************* * * Microchip USB C18 Firmware Version 1.0 * ********************************************************************* * FileName: usbcfg.h * Dependencies: See INCLUDES section below * Processor: PIC18 * Compiler: C18 2.30.01+ * Company: Microchip Technology, Inc. * ********************************************************************/ #ifndef USBCFG_H #define USBCFG_H /** D E F I N I T I O N S *******************************************/ #define EP0_BUFF_SIZE 8 // 8, 16, 32, or 64 #define MAX_NUM_INT 1 // For tracking Alternate Setting /* Parameter definitions are defined in usbdrv.h */ #define MODE_PP _PPBM0 #define UCFG_VAL _PUEN|_TRINT|_FS|MODE_PP #define USE_SELF_POWER_SENSE_IO #define USE_USB_BUS_SENSE_IO /** D E V I C E C L A S S U S A G E *******************************/ // #define USB_USE_CDC #define USB_USE_HID /* * MUID = Microchip USB Class ID * Used to identify which of the USB classes owns the current * session of control transfer over EP0 */ #define MUID_NULL 0 #define MUID_USB9 1 #define MUID_HID 2 #define MUID_CDC 3 #define MUID_MSD 4 /** E N D P O I N T S A L L O C A T I O N **************************/ /* * See usbmmap.c for an explanation of how the endpoint allocation works */ /* CDC */ /* #define CDC_COMM_INTF_ID 0x00 #define CDC_COMM_UEP UEP2 #define CDC_INT_BD_IN ep2Bi #define CDC_INT_EP_SIZE 8 #define CDC_DATA_INTF_ID 0x01 #define CDC_DATA_UEP UEP3 #define CDC_BULK_BD_OUT ep3Bo #define CDC_BULK_OUT_EP_SIZE 64 #define CDC_BULK_BD_IN ep3Bi #define CDC_BULK_IN_EP_SIZE 256 ? */ // #define MAX_EP_NUMBER 3 // UEP3 /* HID */ #define HID_INTF_ID 0x00 #define HID_UEP UEP1 #define HID_BD_OUT ep1Bo #define HID_INT_OUT_EP_SIZE 64 #define HID_BD_IN ep1Bi #define HID_INT_IN_EP_SIZE 48 #define HID_NUM_OF_DSC 1 #define HID_RPT01_SIZE (50+6) #define HID_INPUT_REPORT_BYTES 2 #define HID_OUTPUT_REPORT_BYTES 2 #define HID_FEATURE_REPORT_BYTES 2 /* HID macros */ #define mUSBGetHIDDscAdr(ptr) \ { \ if(usb_active_cfg == 1) \ ptr = (rom byte*)&cfg01.hid_i00a00; \ } #define mUSBGetHIDRptDscAdr(ptr) \ { \ if(usb_active_cfg == 1) \ ptr = (rom byte*)&hid_rpt01; \ } #define mUSBGetHIDRptDscSize(count) \ { \ if(usb_active_cfg == 1) \ count = sizeof(hid_rpt01); \ } #define MAX_EP_NUMBER 1 // UEP2 #endif //USBCFG_H