Page 1 of 1
what is the transfer type of the hid-data example?
Posted: Fri Jun 25, 2010 11:47 am
by vsovereign
What kind of transfer is used in the hid-data example?
Is it control transfer or interrupt transfer?
Because I know only these two can be used by low-speed device.
I think it's control transfer. But I'm not really sure.
I know that control transfer has setup, data and status stages.
But I don't know how this function to the hid-data example.
If someone can explain, please help
Thanks!
Re: what is the transfer type of the hid-data example?
Posted: Fri Jun 25, 2010 6:47 pm
by frank26080115
control transfer, it's using usbFunctionWrite and usbFunctionRead
don't worry about setup and status stages, setup stage should be already finished in usbFunctionSetup, and status stage is taken care of automatically i think
Re: what is the transfer type of the hid-data example?
Posted: Thu Aug 12, 2010 9:46 am
by Vaidot
Good morning everyone!
I'm new in V-USB and I have a few basic type questions. I study a lot about hid-data example ant i can't undestand where information goes before it is writining to eeprom. I think it is some kind of buffer, but i can't understant in which: I think it goes to "uchar data[8]",so it is 8 bytes of information. I need a simple example of this thing, becouse I want to put MY information of x bytes to some kind of buffer, send it to AVR microchip, and there send it using UART. It's no problem of microchip programming for me, but i just need a basic where i need to put my info and where i need to take it.
For example: in computer side where is uchar information[8], i whant it to just put in microchip uchar info[8], how to write usbFunctionRead() and usbFunctionWrite() for this? I think it's simple enough, but i can't understand. I hope someone help me. Thank you.
Re: what is the transfer type of the hid-data example?
Posted: Thu Aug 12, 2010 6:36 pm
by frank26080115
you want to use usbFunctionWrite, not usbFunctionRead
use usbFunctionSetup to determine whether or not you need to read data from the computer, if so, make sure usbFunctionSetup return USB_NO_MSG
then just write your usbFunctionWrite to handle the data, it provides the data in an array and tells you how long the array is, although it has a max of 8.
look at
http://vusb.wikidot.com/driver-api under "Sending data to the device"