firmware/usbcfg.h
author root@rika
Thu, 23 Apr 2009 20:55:41 +0200
changeset 33 7a0c4b0354ba
parent 2 2f55e5dd591d
permissions -rw-r--r--
updated documentation
     1 /*********************************************************************
     2  *
     3  *                Microchip USB C18 Firmware Version 1.0
     4  *
     5  *********************************************************************
     6  * FileName:        usbcfg.h
     7  * Dependencies:    See INCLUDES section below
     8  * Processor:       PIC18
     9  * Compiler:        C18 2.30.01+
    10  * Company:         Microchip Technology, Inc.
    11  *
    12  * Software License Agreement
    13  *
    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
    23  * license.
    24  *
    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.
    31  *
    32  ********************************************************************/
    33 
    34 #ifndef USBCFG_H
    35 #define USBCFG_H
    36 
    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
    40 
    41 /* Parameter definitions are defined in usbdrv.h */
    42 #define MODE_PP                 _PPBM0
    43 #define UCFG_VAL                _PUEN|_TRINT|_FS|MODE_PP
    44 
    45 //#define USE_SELF_POWER_SENSE_IO
    46 //#define USE_USB_BUS_SENSE_IO
    47 
    48 /** D E V I C E  C L A S S  U S A G E *******************************/
    49 #define USB_USE_CDC
    50 
    51 /*
    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
    55  */
    56 #define MUID_NULL               0
    57 #define MUID_USB9               1
    58 #define MUID_HID                2
    59 #define MUID_CDC                3
    60 #define MUID_MSD                4
    61 
    62 /** E N D P O I N T S  A L L O C A T I O N **************************/
    63 /*
    64  * See usbmmap.c for an explanation of how the endpoint allocation works
    65  */
    66 
    67 /* CDC */
    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
    72 
    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
    79 
    80 #define MAX_EP_NUMBER           3           // UEP3
    81 
    82 #endif //USBCFG_H