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