Page 1 of 1

usbSetInterrupt vs HID Report Descriptor

Posted: Wed Oct 27, 2010 11:37 pm
by mirekk36
Hi all,

can anybody help me? I have in my code this HID descriptor:

Code: Select all

PROGMEM char usbHidReportDescriptor[22] = {    /* USB report descriptor */
    0x06, 0x00, 0xff,              // USAGE_PAGE (Generic Desktop)
    0x09, 0x01,                    // USAGE (Vendor Usage 1)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
    0x75, 0x08,                    //   REPORT_SIZE (8)
    0x95, 0x10,                    //   REPORT_COUNT (16)   // tu można dać 0x40 np 64 bajtową ramkę tylko trzeba zwięszyć bufor danych do 64
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0                           // END_COLLECTION
};


I can send and receive any data to and from PC without any problems using functions:

usbFunctionRead()
usbFunctionWrite()

but i have a BIG problem to send some data with:

usbSetInterrupt()

it's don't work anyway.

I feel that this is related to the HID descriptor, but I do not know how to solve the problem. I need to spontaneously send some data to a PC.

Re: usbSetInterrupt vs HID Report Descriptor

Posted: Thu Oct 28, 2010 6:45 pm
by _frank26080115
did you enable the interrupt-in endpoint in usbconfig?

are you looping usbPoll after calling usbSetInterrupt?

is the interrupt-in endpoint ready before usbSetInterrupt is called?

Re: usbSetInterrupt vs HID Report Descriptor

Posted: Fri Oct 29, 2010 9:10 pm
by mirekk36
_frank26080115 wrote:did you enable the interrupt-in endpoint in usbconfig?

Yes ofcourse

_frank26080115 wrote:are you looping usbPoll after calling usbSetInterrupt?


I'm using JvHid component under Dlphi. This componnent pools in a thread , I can see it when I connect someone GamePad and press any key on it. This keycodes appears in this sample program.

_frank26080115 wrote:is the interrupt-in endpoint ready before usbSetInterrupt is called?

Yes I check this.

I only can send and receive some data with set or get feature report on PC to or from my AVR device.

Re: usbSetInterrupt vs HID Report Descriptor

Posted: Sat Oct 30, 2010 8:05 am
by _frank26080115
I think "FEATURE" is host-to-device

Re: usbSetInterrupt vs HID Report Descriptor

Posted: Sat Oct 30, 2010 10:05 am
by dzairo
Hi mirek36.
I too want communicate with Delphi <-> HID avr.
Have any news???

Re: usbSetInterrupt vs HID Report Descriptor

Posted: Sun Oct 31, 2010 12:38 am
by Guest
_frank26080115 wrote:I think "FEATURE" is host-to-device


Yes, U have right, and therefore I'm looking for opportunities to spontaneously send data from device-to-host

Do You have maybe some simple sample or some link to do that ? pls


dzairo wrote:Hi mirek36.
I too want communicate with Delphi <-> HID avr.
Have any news???


Form Delphi code it's quiet simple, you have sample code for Delphi "SimpleHIDWrite.dpr", try it and look how do that from own code.

Re: usbSetInterrupt vs HID Report Descriptor

Posted: Mon Nov 01, 2010 7:07 am
by _frank26080115
I believe "INPUT" is device-to-host

Re: usbSetInterrupt vs HID Report Descriptor

Posted: Tue Nov 02, 2010 11:37 am
by dzairo
Hi
Using JvHID ... with HID is not very easy.
If try exist code (delphi demo) then show any error and no other.
But some user help me to create delphi code using libusb.pas but need install driver in to OS.
If any one know how to create function demo for delphi pls , create and post it .
I still don't know how make it on Delphi with JvHID....

regards

Re: usbSetInterrupt vs HID Report Descriptor

Posted: Thu Sep 15, 2011 5:12 pm
by handco
mirekk36 wrote:Hi all,

can anybody help me? I have in my code this HID descriptor:

Code: Select all

PROGMEM char usbHidReportDescriptor[22] = {    /* USB report descriptor */
    0x06, 0x00, 0xff,              // USAGE_PAGE (Generic Desktop)
    0x09, 0x01,                    // USAGE (Vendor Usage 1)
    0xa1, 0x01,                    // COLLECTION (Application)
    0x15, 0x00,                    //   LOGICAL_MINIMUM (0)
    0x26, 0xff, 0x00,              //   LOGICAL_MAXIMUM (255)
    0x75, 0x08,                    //   REPORT_SIZE (8)
    0x95, 0x10,                    //   REPORT_COUNT (16)   // tu można dać 0x40 np 64 bajtową ramkę tylko trzeba zwięszyć bufor danych do 64
    0x09, 0x00,                    //   USAGE (Undefined)
    0xb2, 0x02, 0x01,              //   FEATURE (Data,Var,Abs,Buf)
    0xc0                           // END_COLLECTION
};


I can send and receive any data to and from PC without any problems using functions:

usbFunctionRead()
usbFunctionWrite()

but i have a BIG problem to send some data with:

usbSetInterrupt()

it's don't work anyway.

I feel that this is related to the HID descriptor, but I do not know how to solve the problem. I need to spontaneously send some data to a PC.


Dear Mirekk36,
which software are you using for exchanging data from/to pc ? I'm using SimpleHIDWrite from the delphi hid example and nothing appears.
Can I have your main.c for AVR ?

regards,
hc