Custom Class Interrupt In

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
markjuggles
Posts: 2
Joined: Wed Jun 17, 2009 4:25 am

Custom Class Interrupt In

Post by markjuggles » Wed Jul 04, 2012 10:04 pm

My goal is to have an I/O device accessible from LibUsbDotNet. This library does not seem to support control transfers so my focus has been on interrupt transfers.

I have created a custom class device with vusb-20120109 which has both Interrupt In and Interrupt Out endpoints. The device is an ATtiny2313 running at 12 MHz.

Interrupt Out is working well: The PC can control an LED with the LSB of the data sent.

Interrupt In is not working at all. Another LED is setup to toggle whenever usbFunctionRead(), usbDeviceRead(), or usbPoll() are called but it does not toggle. The LibUsbDotNet application is returning "Error IoTimedOut reading USB".

How exactly is the Interrupt In endpoint supposed to work? Which function is responsible for supplying the data? Is there a custom class example?

Thank you for any suggestions you can provide. Below is the endpoint part of a lsusb -v command on Linux.

Mark


Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10

ulao
Rank 4
Rank 4
Posts: 481
Joined: Mon Aug 25, 2008 8:45 pm

Re: Custom Class Interrupt In

Post by ulao » Mon Aug 06, 2012 6:48 pm

Maybe I'm not understanding you right here but the in endpoint is used like so.

Code: Select all

while (!usbInterruptIsReady())
{ //poll when not ready
  usbPoll();
}
usbSetInterrupt(reportBuffer, 8 );//send the data


This is using an in interrupt method.

Post Reply