how to use interrupt out transfer in vusb
how to use interrupt out transfer in vusb
by dagakshay » Wed Feb 16, 2011 7:56 am
I HAD UNDERSTOOD THE INTERRUPT IN TRANSFER IN VUSB... PLEASE TELL ME HOW TO USE HOW TO USE INTERRUPT OUT TRANSFER IN VUSB... ANY EXAMPLE OR LINK FOR THAT... HOW TO DECLARE INTERRUPT OUT ENDPOINT
I HAD WENT THROUGH THE LINK:
http://vusb.wikidot.com/driver-api
BUT HERE THEY HAD NOT SHOWN HOW TO DECLARE INTERRUPT OUT ENDPOINT....
Re: how to use interrupt out transfer in vusb
by Augend » Sat Feb 26, 2011 10:13 am
first you need to declare in usb configuration . follow these steps:
1- go to usbdrv.c
2- find this line: PROGMEM char usbDescriptorConfiguration[] = { /* USB configuration descriptor */
3- add seven bites to the length of descriptor as followed in this line:
18 + 7 * USB_CFG_HAVE_INTRIN_ENDPOINT + (USB_CFG_DESCR_PROPS_HID & 0xff) +7, 0, //I added las +7
4-now you need to add one ondpoint . find this line and add 1:
USB_CFG_HAVE_INTRIN_ENDPOINT + 1 , /* endpoints excl 0: number of endpoint descriptors to follow */ // I added last +1
5-now at the end of descriptor add these codes to make a new OUT endpoint:
7, /* sizeof(usbDescrEndpoint) */
USBDESCR_ENDPOINT, /* descriptor type = endpoint */
(char)0x01, /* OUT endpoint number 1 */ //instead of 81
0x03, /* attrib: Interrupt endpoint */
8, 0, /* maximum packet size */
USB_CFG_INTR_POLL_INTERVAL, /* in ms */
You need also to configure your driver to use this interrupt-OUT no-1
6- now go to usbconfig.h and set USB_CFG_IMPLEMENT_FN_WRITEOUT to 1
7- find this line:
#if USB_CFG_IMPLEMENT_FN_WRITEOUT
if(usbRxToken < 0x10){ /* endpoint number in usbRxToken */
and change it to this:
if(usbRxToken == USBPID_OUT){ /* endpoint number in usbRxToken *///*
8-every time device receives Interrupt-out, goes into usbFunctionWriteOut()
tell me if it works for you