/********************************************************************* * * Microchip USB C18 Firmware Version 1.0 * ********************************************************************* * FileName: usb9.h * Dependencies: See INCLUDES section below * Processor: PIC18 * Compiler: C18 2.30.01+ * Company: Microchip Technology, Inc. * * * Author Date Comment *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Rawin Rojvanit 11/19/04 Original. ********************************************************************/ #ifndef USB9_H #define USB9_H /** I N C L U D E S **********************************************************/ #include /** D E F I N I T I O N S ****************************************************/ /****************************************************************************** * Standard Request Codes * USB 2.0 Spec Ref Table 9-4 *****************************************************************************/ #define GET_STATUS 0 #define CLR_FEATURE 1 #define SET_FEATURE 3 #define SET_ADR 5 #define GET_DSC 6 #define SET_DSC 7 #define GET_CFG 8 #define SET_CFG 9 #define GET_INTF 10 #define SET_INTF 11 #define SYNCH_FRAME 12 /* Standard Feature Selectors */ #define DEVICE_REMOTE_WAKEUP 0x01 #define ENDPOINT_HALT 0x00 /****************************************************************************** * Macro: void mUSBCheckAdrPendingState(void) * * PreCondition: None * * Input: None * * Output: None * * Side Effects: None * * Overview: Specialized checking routine, it checks if the device * is in the ADDRESS PENDING STATE and services it if it is. * * Note: None *****************************************************************************/ #define mUSBCheckAdrPendingState() if(usb_device_state==ADR_PENDING_STATE) \ { \ UADDR = SetupPkt.bDevADR._byte; \ if(UADDR > 0) \ usb_device_state=ADDRESS_STATE; \ else \ usb_device_state=DEFAULT_STATE; \ }//end if /** E X T E R N S ************************************************************/ /** P U B L I C P R O T O T Y P E S *****************************************/ void USBCheckStdRequest(void); #endif //USB9_H