what is the transfer type of the hid-data example?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
vsovereign
Rank 1
Rank 1
Posts: 21
Joined: Wed Dec 30, 2009 3:24 pm

what is the transfer type of the hid-data example?

Post by vsovereign » Fri Jun 25, 2010 11:47 am

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!

frank26080115
Rank 2
Rank 2
Posts: 43
Joined: Fri Jun 19, 2009 4:43 pm

Re: what is the transfer type of the hid-data example?

Post by frank26080115 » Fri Jun 25, 2010 6:47 pm

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

Vaidot

Re: what is the transfer type of the hid-data example?

Post by Vaidot » Thu Aug 12, 2010 9:46 am

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.

frank26080115
Rank 2
Rank 2
Posts: 43
Joined: Fri Jun 19, 2009 4:43 pm

Re: what is the transfer type of the hid-data example?

Post by frank26080115 » Thu Aug 12, 2010 6:36 pm

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"

Post Reply