General joystick HID question

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
ozel
Posts: 8
Joined: Tue Nov 06, 2007 6:17 am
Location: Munich, Bavaria

Post by ozel » Mon Nov 19, 2007 11:41 pm

sprhawk:

Can you examine your descriptor somehow as its received on your host?

I could resolve some of my problems with the great tool evtest under linux.
It shows first the supported events of a device in a summary and then just all actual events as they come in.. very helpfull. for example with this I saw setting "0x00, 0xff" as maximum value was not seen as the same as sending just "0xff". (though the register addreses were set accordingly for 1 or 2 byte)

Grendel:

thanks a lot for this example and the very clear bit map. but I have to admit that it still doesn't work at my side. I get only 8 bits transmitted properly. When I send 10bit they are chopped up similar like 16bit. I probably shift the bits wrong. I used nearly the same setup as you for my x and y coordinates, there is just one full byte for the mouse buttons infront of x and y:

Code: Select all

 

//set mouse button one down
reportBuffer[0] = 0x01;

//shifting x and y for 10bit values
reportBuffer[1] = (x & 0xff); //lower 8 bits of x
reportBuffer[2] =  ((y & 0x3f) << 2) | (8 >> (x & 0x300)); //high 2 bit of x to the right, 6 low bits of y to the left
//               0x3f= 11 1111           0x300 = 11 0000 0000
reportBuffer[3] = (6 >> (y & 0x3C0));  //0x3c0 = 11 1100 0000 //put the remaining 4 bits of y at the left end


After X and Y, I fill the report descripter properly with 4 bits, to get 4 * 8 in total. How do you put your 10bit values together in the buffer?

Also can someone explain for me what the differences between logical and physical maxiums are, when used for an absolute device? I don't get it! I just set them the same, in this case to 10bit max each.

Oli

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Post by Grendel » Wed Nov 21, 2007 1:47 am

ozel wrote:After X and Y, I fill the report descripter properly with 4 bits, to get 4 * 8 in total. How do you put your 10bit values together in the buffer?

The bits are sort of "reversed" in the bytes of the report:
Grendel wrote:The report data array is defined as:

Code: Select all

uint8_t
    sw_report[7] ;                              // USB report data

//      USB report data structure
//      =========================
//
//      -------0 -------1 -------2 -------3 -------4 -------5 -------6
//      XXXXXXXX YYYYYYXX RRRRYYYY HHHRRRRR BBBBBBBH TTTTTTTB 00000TTT
//      76543210 54321098 32109876 21087654 76543213 65432108      987
//
//      R = Rz, H = POV hat, B = button, T = throttle

-------0 is byte #0 in sw_report, -------1 byte #1, etc. The bit order in those bytes is 76543210. The coding in the column below each bit tells you what is stored there: X0 = X axis bit #0, Y4 = Y axis bit #4. If you rewrite everything w/ low bits first it's pretty clear how the report works:

Code: Select all

//      01234567 01234567 ..
//      0------- 1------- 2------- 3------- 4------- 5------- 6-------
//      XXXXXXXX XXYYYYYY YYYYRRRR RRRRRHHH HBBBBBBB BTTTTTTT TTT00000
//      01234567 89012345 67890123 45678012 31234567 80123456 78900000


The 10bit values are signed BTW. Range is -512 to 511 as defined in logical min/max.

ozel wrote:for example with this I saw setting "0x00, 0xff" as maximum value was not seen as the same as sending just "0xff". (though the register addreses were set accordingly for 1 or 2 byte)

These values are signed -- 0xFF is negative, 0x00FF is not.

ozel wrote:Also can someone explain for me what the differences between logical and physical maxiums are, when used for an absolute device? I don't get it! I just set them the same, in this case to 10bit max each.


Device Class Definition For HID, v1.11, chapter 6.2.2.7 Global Items wrote:Logical Minimum 0001 01 nn
Extent value in logical units. This is the minimum value that a variable or array item will report. For example, a mouse reporting x position values from 0 to 128 would have a Logical Minimum of 0 and a Logical Maximum of 128.

Logical Maximum 0010 01 nn
Extent value in logical units. This is the maximum value that a variable or array item will report.

Physical Minimum 0011 01 nn
Minimum value for the physical extent of a variable item. This represents the Logical Minimum with units applied to it.

Physical Maximum 0100 01 nn
Maximum value for the physical extent of a variable item.

sprhawk
Posts: 11
Joined: Sun Oct 28, 2007 5:52 am

Post by sprhawk » Wed Nov 21, 2007 5:26 am

ozel wrote:sprhawk:

Can you examine your descriptor somehow as its received on your host?

I could resolve some of my problems with the great tool evtest under linux.
It shows first the supported events of a device in a summary and then just all actual events as they come in.. very helpfull. for example with this I saw setting "0x00, 0xff" as maximum value was not seen as the same as sending just "0xff". (though the register addreses were set accordingly for 1 or 2 byte)



I solved my problem by replacing the usbdrv with a new one.

I didn't find why. It just ok now. Thank you all the same!

WaaZaa
Posts: 4
Joined: Wed Dec 05, 2007 11:30 am

Post by WaaZaa » Wed Dec 05, 2007 11:53 am

I am still trying to get mine working, as I stated in another thread a little while ago ;)

I am trying to get reports sent to the PC, but the avr doesn't seem to be sending anything.. For the record, I am using an atmega16, but that shouldn't change anything..

It's strange because the device is recognized by windows, gamecontrollers shows this:
Image
I'm guessing this means the enumeration is going correct, but the interrupts after are not received correctly?

I also added a usbtrace log on my webserver, the device desciption it gives and a list of transfers received and sent. This is a cycle which keeps repeating itself.. http://www.waazaa.net/usb/

I'm just adding my code here..

Code: Select all

/**********************Global Variables****************************************/
/* Originally used as a mask for the modifier bits, but now also
   used for other x -> 2^x conversions (lookup table). */
const char modmask[8] PROGMEM = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
uchar  adcData[8] ={0,0,0,0,0,0,0,0}; //int to store the AD conversion results in.
uchar newDataFound;
uchar   updateNeeded = 0;

/* The ReportBuffer contains the USB report sent to the PC */
static uchar reportBuffer[8] = {0,0,0,0,0,0,0,0};    /* buffer for HID reports */
static uchar idleRate;           /* in 4 ms units */


/* Device serial number (length is defined in usbconfig.h) */
int usbCfgSerialNumberStringDescriptor[USB_CFG_SERIAL_NUMBER_LENGTH+1] PROGMEM =
{
    USB_STRING_DESCRIPTOR_HEADER(USB_CFG_SERIAL_NUMBER_LENGTH),
    '1', '3',
};

/* USB report descriptor (length is defined in usbconfig.h)*/
const char usbHidReportDescriptor[USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH]
  PROGMEM = {
     0x05, 0x01,                    // USAGE_PAGE (Generic Desktop)
    0x15, 0x00,                    // LOGICAL_MINIMUM (0)
    0x09, 0x04,                    // USAGE (Joystick)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x09, 0x01,                    //   USAGE (Pointer)
    0xa1, 0x00,                    //   COLLECTION (Physical)
    0x95, 0x06,                    //     REPORT_COUNT (6)
    0x75, 0x08,                    //     REPORT_SIZE (8)
    0x15, 0x80,                    //     LOGICAL_MINIMUM (-128)
    0x25, 0x7f,                    //     LOGICAL_MAXIMUM (127)
    0x35, 0x00,                    //     PHYSICAL_MINIMUM (0)
    0x46, 0xff, 0x00,              //     PHYSICAL_MAXIMUM (255)
    0x09, 0x31,                    //     USAGE (Y)
    0x09, 0x30,                    //     USAGE (X)
    0x09, 0x32,                    //     USAGE (Z)
    0x09, 0x33,                    //     USAGE (Rx)
    0x09, 0x34,                    //     USAGE (Ry)
    0x09, 0x35,                    //     USAGE (Rz)
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
    0x95, 0x08,                    //     REPORT_COUNT (8)
    0x75, 0x01,                    //     REPORT_SIZE (1)
    0x15, 0x00,                    //     LOGICAL_MINIMUM (0)
    0x25, 0x01,                    //     LOGICAL_MAXIMUM (1)
    0x35, 0x00,                    //     PHYSICAL_MINIMUM (0)
    0x45, 0x01,                    //     PHYSICAL_MAXIMUM (1)
    0xc0,                          // END_COLLECTION
    0x05, 0x09,                    //     USAGE_PAGE (Button)
    0x19, 0x01,                    //     USAGE_MINIMUM (Button 1)
    0x29, 0x08,                    //     USAGE_MAXIMUM (Button 8)
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)
    0xc0                           //     END_COLLECTION                 
};

/**********************||Global Variables||****************************************/




static void hardwareInit(void) {
  uchar   i, j;

   /* 1101 1000 bin: activate pull-ups except on USB lines
    *
    * USB signals are on bit 0 and 2.
    *
    * */
   PORTD = 0xf8;   

   /* Usb pin are init as outputs */
   DDRD = 0x01 | 0x04;   

   
   j = 0;
   while(--j){     /* USB Reset by device only required on Watchdog Reset */
      i = 0;
      while(--i); /* delay >10ms for USB reset */
   }
   DDRD = 0x00;    /* 0000 0000 bin: remove USB reset condition */
   
   /* configure timer 0 for a rate of 12M/(1024 * 256) = 45.78 Hz (~22ms) */
   TCCR0 = 5;      /* timer 0 prescaler: 1024 */

   TCCR2 = (1<<WGM21)|(1<<CS22)|(1<<CS21)|(1<<CS20);
   OCR2 = 196; // for 60 hz
}


//Initialize the AD converter.
void Init_ADC( void )
{
   //          enable     *      prescaler = 128       *
    ADCSRA  = (1<<ADEN)|(1<<ADPS2)|(0<<ADPS1)|(1<<ADPS0);
}


uchar   usbFunctionSetup(uchar data[8]) {
  usbRequest_t *rq = (void *)data;
  usbMsgPtr = reportBuffer;
  if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS){    /* class request type */
    if(rq->bRequest == USBRQ_HID_GET_REPORT){  /* wValue: ReportType (highbyte), ReportID (lowbyte) */
      /* we only have one report type, so don't look at wValue */
      return sizeof(reportBuffer);
    }else if(rq->bRequest == USBRQ_HID_GET_IDLE){
      usbMsgPtr = &idleRate;
      return 1;
    }else if(rq->bRequest == USBRQ_HID_SET_IDLE){
      idleRate = rq->wValue.bytes[1];
    }
  }else{
    /* no vendor specific requests implemented */
  }
   return 0;
}


 
void inDecoderPoll(void)
{
   
   for (unsigned int i = 0; i < 8; i++)   
   {
       
      ADMUX = i;                 // select ADC channel
      ADMUX |= (0<<REFS1)|(1<<REFS0)|(1<<ADLAR);
      ADCSRA |= (1<<ADSC);         // start conversion
        while (ADCSRA & (1<<ADSC)){;} // wait for result (fast, not a problem for USB driver)
        adcData[i] = ADCH;          // save to data buffer
      
    }
    // set new data flag
    newDataFound = 1;
}

void buildReport(void)
{
   for (unsigned int i =0; i<7; i++)
   {
          //just using channel 7 value for now.
      reportBuffer[i+1] = adcData[7];
   }
}

void testMeth(void)
{
   
   if(usbInterruptIsReady())
   {
      // led on
      PORTB = 0x00;
      DDRB = 0x01;
   }
   else
   {
      //led off.
      DDRB = 0x00;
   }

}



int   main(void) {
     
      
   wdt_enable(WDTO_2S); /* Enable watchdog timer 2s */
   hardwareInit(); /* Initialize hardware (I/O) */
   Init_ADC();

   usbInit(); /* Initialize USB stack processing */
   sei(); /* Enable global interrupts */
      
   
   for(;;)
   {   /* Main loop */
      wdt_reset(); /* Reset the watchdog */
      usbPoll(); /* Poll the USB stack */
      
      
      inDecoderPoll();
   
      /* If an update is needed, send the report */
      if(usbInterruptIsReady())
      {
            
            buildReport();
            testMeth();
            usbSetInterrupt(reportBuffer, sizeof(reportBuffer));
      }
   
   }
   return 0;
}
Last edited by WaaZaa on Wed Dec 05, 2007 4:08 pm, edited 1 time in total.

WaaZaa
Posts: 4
Joined: Wed Dec 05, 2007 11:30 am

Post by WaaZaa » Wed Dec 05, 2007 1:47 pm

also added my usbconfig.h


I'm lost to whats wrong here.. :/

Code: Select all

/* Name: usbconfig.h
 * Project: AVR USB driver
 * Author: Christian Starkjohann
 * Creation Date: 2005-04-01
 * Tabsize: 4
 * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH
 * License: GNU GPL v2 (see License.txt) or proprietary (CommercialLicense.txt)
 * This Revision: $Id: usbconfig-prototype.h 404 2007-11-06 11:22:17Z cs $
 */

#ifndef __usbconfig_h_included__
#define __usbconfig_h_included__

/*
General Description:
This file is an example configuration (with inline documentation) for the USB
driver. It configures AVR-USB for an ATMega8 with USB D+ connected to Port D
bit 2 (which is also hardware interrupt 0) and USB D- to Port D bit 0. You may
wire the lines to any other port, as long as D+ is also wired to INT0.
To create your own usbconfig.h file, copy this file to the directory
containing "usbdrv" (that is your project firmware source directory) and
rename it to "usbconfig.h". Then edit it accordingly.
*/

/* ---------------------------- Hardware Config ---------------------------- */

#define USB_CFG_IOPORTNAME      D
/* This is the port where the USB bus is connected. When you configure it to
 * "B", the registers PORTB, PINB and DDRB will be used.
 */
#define USB_CFG_DMINUS_BIT      0
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.
 * This may be any bit in the port.
 */
#define USB_CFG_DPLUS_BIT       2
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.
 * This may be any bit in the port. Please note that D+ must also be connected
 * to interrupt pin INT0!
 */
/* #define USB_CFG_CLOCK_KHZ       (F_CPU/1000) */
/* Clock rate of the AVR in MHz. Legal values are 12000, 15000, 16000 or 16500.
 * The 16.5 MHz version of the code requires no crystal, it tolerates +/- 1%
 * deviation from the nominal frequency. All other rates require a precision
 * of 2000 ppm and thus a crystal!
 * Default if not specified: 12 MHz
 */

/* ----------------------- Optional Hardware Config ------------------------ */

/* #define USB_CFG_PULLUP_IOPORTNAME   D */
/* If you connect the 1.5k pullup resistor from D- to a port pin instead of
 * V+, you can connect and disconnect the device from firmware by calling
 * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h).
 * This constant defines the port on which the pullup resistor is connected.
 */
/* #define USB_CFG_PULLUP_BIT          4 */
/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined
 * above) where the 1.5k pullup resistor is connected. See description
 * above for details.
 */

/* --------------------------- Functional Range ---------------------------- */

#define USB_CFG_HAVE_INTRIN_ENDPOINT    1
/* Define this to 1 if you want to compile a version with two endpoints: The
 * default control endpoint 0 and an interrupt-in endpoint (any other endpoint
 * number).
 */
#define USB_CFG_HAVE_INTRIN_ENDPOINT3   0
/* Define this to 1 if you want to compile a version with three endpoints: The
 * default control endpoint 0, an interrupt-in endpoint 3 (or the number
 * configured below) and a catch-all default interrupt-in endpoint as above.
 * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature.
 */
#define USB_CFG_EP3_NUMBER              3
/* If the so-called endpoint 3 is used, it can now be configured to any other
 * endpoint number (except 0) with this macro. Default if undefined is 3.
 */
/* #define USB_INITIAL_DATATOKEN           USBPID_DATA0 */
/* The above macro defines the startup condition for data toggling on the
 * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA0.
 */
#define USB_CFG_IMPLEMENT_HALT          0
/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature
 * for endpoint 1 (interrupt endpoint). Although you may not need this feature,
 * it is required by the standard. We have made it a config option because it
 * bloats the code considerably.
 */
#define USB_CFG_INTR_POLL_INTERVAL      20
/* If you compile a version with endpoint 1 (interrupt-in), this is the poll
 * interval. The value is in milliseconds and must not be less than 10 ms for
 * low speed devices.
 */
#define USB_CFG_IS_SELF_POWERED         0
/* Define this to 1 if the device has its own power supply. Set it to 0 if the
 * device is powered from the USB bus.
 */
#define USB_CFG_MAX_BUS_POWER           100
/* Set this variable to the maximum USB bus power consumption of your device.
 * The value is in milliamperes. [It will be divided by two since USB
 * communicates power requirements in units of 2 mA.]
 */
#define USB_CFG_IMPLEMENT_FN_WRITE      0
/* Set this to 1 if you want usbFunctionWrite() to be called for control-out
 * transfers. Set it to 0 if you don't need it and want to save a couple of
 * bytes.
 */
#define USB_CFG_IMPLEMENT_FN_READ       0
/* Set this to 1 if you need to send control replies which are generated
 * "on the fly" when usbFunctionRead() is called. If you only want to send
 * data from a static buffer, set it to 0 and return the data from
 * usbFunctionSetup(). This saves a couple of bytes.
 */
#define USB_CFG_IMPLEMENT_FN_WRITEOUT   0
/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints.
 * You must implement the function usbFunctionWriteOut() which receives all
 * interrupt/bulk data sent to any endpoint other than 0. The endpoint number
 * can be found in 'usbRxToken'.
 */
#define USB_CFG_HAVE_FLOWCONTROL        0
/* Define this to 1 if you want flowcontrol over USB data. See the definition
 * of the macros usbDisableAllRequests() and usbEnableAllRequests() in
 * usbdrv.h.
 */
/* #define USB_RX_USER_HOOK(data, len)     if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */
/* This macro is a hook if you want to do unconventional things. If it is
 * defined, it's inserted at the beginning of received message processing.
 * If you eat the received message and don't want default processing to
 * proceed, do a return after doing your things. One possible application
 * (besides debugging) is to flash a status LED on each packet.
 */
#define USB_COUNT_SOF                   0
/* define this macro to 1 if you need the global variable "usbSofCount" which
 * counts SOF packets. This feature requires that the hardware interrupt is
 * connected to D-.
 */

/* -------------------------- Device Description --------------------------- */

#define  USB_CFG_VENDOR_ID       0xc0, 0x16
/* USB vendor ID for the device, low byte first. If you have registered your
 * own Vendor ID, define it here. Otherwise you use obdev's free shared
 * VID/PID pair. Be sure to read USBID-License.txt for rules!
 * This template uses obdev's shared VID/PID pair for HIDs: 0x16c0/0x5df.
 * Use this VID/PID pair ONLY if you understand the implications!
 */
#define  USB_CFG_DEVICE_ID       0xdf, 0x05
/* This is the ID of the product, low byte first. It is interpreted in the
 * scope of the vendor ID. If you have registered your own VID with usb.org
 * or if you have licensed a PID from somebody else, define it here. Otherwise
 * you use obdev's free shared VID/PID pair. Be sure to read the rules in
 * USBID-License.txt!
 * This template uses obdev's shared VID/PID pair for HIDs: 0x16c0/0x5df.
 * Use this VID/PID pair ONLY if you understand the implications!
 */
#define USB_CFG_DEVICE_VERSION  0x00, 0x01
/* Version number of the device: Minor number first, then major number.
 */
#define USB_CFG_VENDOR_NAME     'w', 'w', 'w', '.', 'o', 'b', 'd', 'e', 'v', '.', 'a', 't'
#define USB_CFG_VENDOR_NAME_LEN 12
/* These two values define the vendor name returned by the USB device. The name
 * must be given as a list of characters under single quotes. The characters
 * are interpreted as Unicode (UTF-16) entities.
 * If you don't want a vendor name string, undefine these macros.
 * ALWAYS define a vendor name containing your Internet domain name if you use
 * obdev's free shared VID/PID pair. See the file USBID-License.txt for
 * details.
 */
#define USB_CFG_DEVICE_NAME     'T', 'e', 'm', 'p', 'l', 'a', 't', 'e'
#define USB_CFG_DEVICE_NAME_LEN 8
/* Same as above for the device name. If you don't want a device name, undefine
 * the macros. See the file USBID-License.txt before you assign a name if you
 * use a shared VID/PID.
 */
#define USB_CFG_SERIAL_NUMBER   '0', '2'
#define USB_CFG_SERIAL_NUMBER_LEN   2
/* Same as above for the serial number. If you don't want a serial number,
 * undefine the macros.
 * It may be useful to provide the serial number through other means than at
 * compile time. See the section about descriptor properties below for how
 * to fine tune control over USB descriptors such as the string descriptor
 * for the serial number.
 */
#define USB_CFG_DEVICE_CLASS        0
#define USB_CFG_DEVICE_SUBCLASS     0
/* See USB specification if you want to conform to an existing device class.
 */
#define USB_CFG_INTERFACE_CLASS     3   /* HID */
#define USB_CFG_INTERFACE_SUBCLASS  0
#define USB_CFG_INTERFACE_PROTOCOL  0
/* See USB specification if you want to conform to an existing device class or
 * protocol.
 * This template defines a HID class device. If you implement a vendor class
 * device, set USB_CFG_INTERFACE_CLASS to 0 and USB_CFG_DEVICE_CLASS to 0xff.
 */
#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH    61  /* total length of report descriptor */
/* Define this to the length of the HID report descriptor, if you implement
 * an HID device. Otherwise don't define it or define it to 0.
 * Since this template defines a HID device, it must also specify a HID
 * report descriptor length. You must add a PROGMEM character array named
 * "usbHidReportDescriptor" to your code which contains the report descriptor.
 * Don't forget to keep the array and this define in sync!
 */

/* #define USB_PUBLIC static */
/* Use the define above if you #include usbdrv.c instead of linking against it.
 * This technique saves a couple of bytes in flash memory.
 */

/* ------------------- Fine Control over USB Descriptors ------------------- */
/* If you don't want to use the driver's default USB descriptors, you can
 * provide our own. These can be provided as (1) fixed length static data in
 * flash memory, (2) fixed length static data in RAM or (3) dynamically at
 * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more
 * information about this function.
 * Descriptor handling is configured through the descriptor's properties. If
 * no properties are defined or if they are 0, the default descriptor is used.
 * Possible properties are:
 *   + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched
 *     at runtime via usbFunctionDescriptor().
 *   + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found
 *     in static memory is in RAM, not in flash memory.
 *   + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash),
 *     the driver must know the descriptor's length. The descriptor itself is
 *     found at the address of a well known identifier (see below).
 * List of static descriptor names (must be declared PROGMEM if in flash):
 *   char usbDescriptorDevice[];
 *   char usbDescriptorConfiguration[];
 *   char usbDescriptorHidReport[];
 *   char usbDescriptorString0[];
 *   int usbDescriptorStringVendor[];
 *   int usbDescriptorStringDevice[];
 *   int usbDescriptorStringSerialNumber[];
 * Other descriptors can't be provided statically, they must be provided
 * dynamically at runtime.
 *
 * Descriptor properties are or-ed or added together, e.g.:
 * #define USB_CFG_DESCR_PROPS_DEVICE   (USB_PROP_IS_RAM | USB_PROP_LENGTH(18))
 *
 * The following descriptors are defined:
 *   USB_CFG_DESCR_PROPS_DEVICE
 *   USB_CFG_DESCR_PROPS_CONFIGURATION
 *   USB_CFG_DESCR_PROPS_STRINGS
 *   USB_CFG_DESCR_PROPS_STRING_0
 *   USB_CFG_DESCR_PROPS_STRING_VENDOR
 *   USB_CFG_DESCR_PROPS_STRING_PRODUCT
 *   USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER
 *   USB_CFG_DESCR_PROPS_HID
 *   USB_CFG_DESCR_PROPS_HID_REPORT
 *   USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver)
 *
 */

#define USB_CFG_DESCR_PROPS_DEVICE                  0
#define USB_CFG_DESCR_PROPS_CONFIGURATION           0
#define USB_CFG_DESCR_PROPS_STRINGS                 0
#define USB_CFG_DESCR_PROPS_STRING_0                0
#define USB_CFG_DESCR_PROPS_STRING_VENDOR           0
#define USB_CFG_DESCR_PROPS_STRING_PRODUCT          0
#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER    0
#define USB_CFG_DESCR_PROPS_HID                     0
#define USB_CFG_DESCR_PROPS_HID_REPORT              0
#define USB_CFG_DESCR_PROPS_UNKNOWN                 0

/* ----------------------- Optional MCU Description ------------------------ */

/* The following configurations have working defaults in usbdrv.h. You
 * usually don't need to set them explicitly. Only if you want to run
 * the driver on a device which is not yet supported or with a compiler
 * which is not fully supported (such as IAR C) or if you use a differnt
 * interrupt than INT0, you may have to define some of these.
 */
/* #define USB_INTR_CFG            MCUCR */
/* #define USB_INTR_CFG_SET        ((1 << ISC00) | (1 << ISC01)) */
/* #define USB_INTR_CFG_CLR        0 */
/* #define USB_INTR_ENABLE         GIMSK */
/* #define USB_INTR_ENABLE_BIT     INT0 */
/* #define USB_INTR_PENDING        GIFR */
/* #define USB_INTR_PENDING_BIT    INTF0 */
/* #define USB_INTR_VECTOR         SIG_INTERRUPT0 */

#endif /* __usbconfig_h_included__ */


soliars
Posts: 3
Joined: Fri Feb 22, 2008 9:07 am
Contact:

Post by soliars » Fri Feb 22, 2008 9:11 am

I think I should think it over and over... :shock:

Post Reply