2 * Copyright (C) 2009 Ubixum, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #include <fx2macros.h>
27 //************************** Configuration Handlers *****************************
29 // change to support as many interfaces as you need
30 //volatile xdata BYTE interface=0;
31 //volatile xdata BYTE alt=0; // alt interface
33 // set *alt_ifc to the current alt interface for ifc
34 BOOL handle_get_interface(BYTE ifc, BYTE* alt_ifc) {
38 // return TRUE if you set the interface requested
39 // NOTE this function should reconfigure and reset the endpoints
40 // according to the interface descriptors you provided.
41 BOOL handle_set_interface(BYTE ifc,BYTE alt_ifc) {
42 printf ( "Set Interface.\n" );
48 // handle getting and setting the configuration
49 // 1 is the default. If you support more than one config
50 // keep track of the config number and return the correct number
51 // config numbers are set int the dscr file.
52 //volatile BYTE config=1;
53 BYTE handle_get_configuration() {
57 // NOTE changing config requires the device to reset all the endpoints
58 BOOL handle_set_configuration(BYTE cfg) {
59 printf ( "Set Configuration.\n" );
65 //******************* VENDOR COMMAND HANDLERS **************************
68 BOOL handle_vendorcommand(BYTE cmd) {
69 // your custom vendor handler code here..
70 return FALSE; // not handled by handlers
74 //******************** INIT ***********************
82 // config your endpoints etc.
85 printf ( "Initialization Done.\n" );