So how do you get data from ENDPOINT ?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

So how do you get data from ENDPOINT ?

Post by ulao » Wed May 05, 2010 1:02 am

If usbSetInterrupt is to send data to the host, how to you capture data?


I added USBRQ_HID_SET_REPOR to my function set up.

Code: Select all

unsigned  usbFunctionSetup(uchar data[8])
{

   usbRequest_t    *rq = (void *)data;
   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 8;
      }
   }
   else if(rq->bRequest == USBRQ_HID_SET_REPORT){
      if (rq->wLength.word == 1) { /* We expect one byte reports */
        expectReport=1;
        return 0xFF; /* Call usbFunctionWrite with data */
      }
    }
   else
   {
   /* no vendor specific requests implemented */
   }
   return 0;
}


and I added a

Code: Select all

uchar   usbFunctionWrite(uchar *data, uchar len)
{
   blinkLed(1);

}

but I'm never hitting the blink.

Post Reply