00001 /* 00002 00003 Copyright (c) 2010, Embedded Adventures, www.embeddedadventures.com 00004 All rights reserved. 00005 00006 Redistribution and use in source and binary forms, with or without 00007 modification, are permitted provided that the following conditions are met: 00008 00009 - Redistributions of source code must retain the above copyright notice, 00010 this list of conditions and the following disclaimer. 00011 00012 - Redistributions in binary form must reproduce the above copyright 00013 notice, this list of conditions and the following disclaimer in the 00014 documentation and/or other materials provided with the distribution. 00015 00016 - Neither the name of Embedded Adventures nor the names of its contributors 00017 may be used to endorse or promote products derived from this software 00018 without specific prior written permission. 00019 00020 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00021 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00022 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00023 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00024 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00025 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00026 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00027 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00028 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00029 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 00030 THE POSSIBILITY OF SUCH DAMAGE. 00031 00032 Contact us at admin@embeddedadventures.com 00033 */ 00034 00040 #include "config.h" 00041 00042 // PicPack includes 00043 #include "pic_usb.h" 00044 #include "pic_usb_buffer_mgt.h" 00045 #include "pic_serial.h" 00046 00047 // local includes 00048 #include "usb_hid_class.h" 00049 00050 // system includes 00051 #include "memory.h" 00052 00053 00054 void usb_handle_class_ctrl_read_callback() { 00055 } 00056 00057 void usb_handle_class_ctrl_write_callback(uns8 *data, uns16 count) { 00058 } 00059 00060 void usb_handle_class_request_callback(setup_data_packet sdp) { 00061 #ifdef USB_DEBUG 00062 serial_print_str("Class request: "); 00063 serial_print_int(sdp.bRequest); 00064 #endif 00065 00066 switch(sdp.bRequest) { 00067 case req_GET_REPORT: 00068 #ifdef USB_DEBUG 00069 serial_print_str(" Set_idle "); 00070 #endif 00071 break; 00072 case req_GET_IDLE: 00073 break; 00074 case req_GET_PROTOCOL: 00075 break; 00076 case req_SET_REPORT: 00077 #ifdef USB_DEBUG 00078 serial_print_str(" Set_report "); 00079 #endif 00080 break; 00081 case req_SET_IDLE: 00082 #ifdef USB_DEBUG 00083 serial_print_str(" Set_idle "); 00084 #endif 00085 // we don't support whatever they want 00086 usb_stall_ep0(); 00087 break; 00088 case req_SET_PROTOCOL: 00089 break; 00090 00091 } 00092 00093 } 00094