00001 /********************************************************************* 00002 * 00003 * Microchip USB C18 Firmware Version 1.0 00004 * 00005 ********************************************************************* 00006 * FileName: usb9.h 00007 * Dependencies: See INCLUDES section below 00008 * Processor: PIC18 00009 * Compiler: C18 2.30.01+ 00010 * Company: Microchip Technology, Inc. 00011 * 00012 * Software License Agreement 00013 * 00014 * The software supplied herewith by Microchip Technology Incorporated 00015 * (the “Company”) for its PICmicro® Microcontroller is intended and 00016 * supplied to you, the Company’s customer, for use solely and 00017 * exclusively on Microchip PICmicro Microcontroller products. The 00018 * software is owned by the Company and/or its supplier, and is 00019 * protected under applicable copyright laws. All rights are reserved. 00020 * Any use in violation of the foregoing restrictions may subject the 00021 * user to criminal sanctions under applicable laws, as well as to 00022 * civil liability for the breach of the terms and conditions of this 00023 * license. 00024 * 00025 * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, 00026 * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED 00027 * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00028 * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, 00029 * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR 00030 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. 00031 * 00032 * Author Date Comment 00033 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00034 * Rawin Rojvanit 11/19/04 Original. 00035 ********************************************************************/ 00036 #ifndef USB9_H 00037 #define USB9_H 00038 00039 /** I N C L U D E S **********************************************************/ 00040 #include "system\typedefs.h" 00041 00042 /** D E F I N I T I O N S ****************************************************/ 00043 00044 /****************************************************************************** 00045 * Standard Request Codes 00046 * USB 2.0 Spec Ref Table 9-4 00047 *****************************************************************************/ 00048 #define GET_STATUS 0 00049 #define CLR_FEATURE 1 00050 #define SET_FEATURE 3 00051 #define SET_ADR 5 00052 #define GET_DSC 6 00053 #define SET_DSC 7 00054 #define GET_CFG 8 00055 #define SET_CFG 9 00056 #define GET_INTF 10 00057 #define SET_INTF 11 00058 #define SYNCH_FRAME 12 00059 00060 /* Standard Feature Selectors */ 00061 #define DEVICE_REMOTE_WAKEUP 0x01 00062 #define ENDPOINT_HALT 0x00 00063 00064 /****************************************************************************** 00065 * Macro: void mUSBCheckAdrPendingState(void) 00066 * 00067 * PreCondition: None 00068 * 00069 * Input: None 00070 * 00071 * Output: None 00072 * 00073 * Side Effects: None 00074 * 00075 * Overview: Specialized checking routine, it checks if the device 00076 * is in the ADDRESS PENDING STATE and services it if it is. 00077 * 00078 * Note: None 00079 *****************************************************************************/ 00080 #define mUSBCheckAdrPendingState() if(usb_device_state==ADR_PENDING_STATE) \ 00081 { \ 00082 UADDR = SetupPkt.bDevADR._byte; \ 00083 if(UADDR > 0) \ 00084 usb_device_state=ADDRESS_STATE; \ 00085 else \ 00086 usb_device_state=DEFAULT_STATE; \ 00087 }//end if 00088 00089 /** E X T E R N S ************************************************************/ 00090 00091 /** P U B L I C P R O T O T Y P E S *****************************************/ 00092 void USBCheckStdRequest(void); 00093 00094 #endif //USB9_H