firmware/usbcfg.h
changeset 2 2f55e5dd591d
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/firmware/usbcfg.h	Tue Jan 29 22:31:52 2008 +0100
     1.3 @@ -0,0 +1,82 @@
     1.4 +/*********************************************************************
     1.5 + *
     1.6 + *                Microchip USB C18 Firmware Version 1.0
     1.7 + *
     1.8 + *********************************************************************
     1.9 + * FileName:        usbcfg.h
    1.10 + * Dependencies:    See INCLUDES section below
    1.11 + * Processor:       PIC18
    1.12 + * Compiler:        C18 2.30.01+
    1.13 + * Company:         Microchip Technology, Inc.
    1.14 + *
    1.15 + * Software License Agreement
    1.16 + *
    1.17 + * The software supplied herewith by Microchip Technology Incorporated
    1.18 + * (the “Company”) for its PICmicro® Microcontroller is intended and
    1.19 + * supplied to you, the Company’s customer, for use solely and
    1.20 + * exclusively on Microchip PICmicro Microcontroller products. The
    1.21 + * software is owned by the Company and/or its supplier, and is
    1.22 + * protected under applicable copyright laws. All rights are reserved.
    1.23 + * Any use in violation of the foregoing restrictions may subject the
    1.24 + * user to criminal sanctions under applicable laws, as well as to
    1.25 + * civil liability for the breach of the terms and conditions of this
    1.26 + * license.
    1.27 + *
    1.28 + * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
    1.29 + * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
    1.30 + * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
    1.31 + * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
    1.32 + * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
    1.33 + * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
    1.34 + *
    1.35 + ********************************************************************/
    1.36 +
    1.37 +#ifndef USBCFG_H
    1.38 +#define USBCFG_H
    1.39 +
    1.40 +/** D E F I N I T I O N S *******************************************/
    1.41 +#define EP0_BUFF_SIZE           8   // 8, 16, 32, or 64
    1.42 +#define MAX_NUM_INT             1   // For tracking Alternate Setting
    1.43 +
    1.44 +/* Parameter definitions are defined in usbdrv.h */
    1.45 +#define MODE_PP                 _PPBM0
    1.46 +#define UCFG_VAL                _PUEN|_TRINT|_FS|MODE_PP
    1.47 +
    1.48 +//#define USE_SELF_POWER_SENSE_IO
    1.49 +//#define USE_USB_BUS_SENSE_IO
    1.50 +
    1.51 +/** D E V I C E  C L A S S  U S A G E *******************************/
    1.52 +#define USB_USE_CDC
    1.53 +
    1.54 +/*
    1.55 + * MUID = Microchip USB Class ID
    1.56 + * Used to identify which of the USB classes owns the current
    1.57 + * session of control transfer over EP0
    1.58 + */
    1.59 +#define MUID_NULL               0
    1.60 +#define MUID_USB9               1
    1.61 +#define MUID_HID                2
    1.62 +#define MUID_CDC                3
    1.63 +#define MUID_MSD                4
    1.64 +
    1.65 +/** E N D P O I N T S  A L L O C A T I O N **************************/
    1.66 +/*
    1.67 + * See usbmmap.c for an explanation of how the endpoint allocation works
    1.68 + */
    1.69 +
    1.70 +/* CDC */
    1.71 +#define CDC_COMM_INTF_ID        0x00
    1.72 +#define CDC_COMM_UEP            UEP2
    1.73 +#define CDC_INT_BD_IN           ep2Bi
    1.74 +#define CDC_INT_EP_SIZE         8
    1.75 +
    1.76 +#define CDC_DATA_INTF_ID        0x01
    1.77 +#define CDC_DATA_UEP            UEP3
    1.78 +#define CDC_BULK_BD_OUT         ep3Bo
    1.79 +#define CDC_BULK_OUT_EP_SIZE    64
    1.80 +#define CDC_BULK_BD_IN          ep3Bi
    1.81 +#define CDC_BULK_IN_EP_SIZE     64
    1.82 +
    1.83 +#define MAX_EP_NUMBER           3           // UEP3
    1.84 +
    1.85 +#endif //USBCFG_H