doing somthing unstandard, can I ?

6 views
Skip to first unread message

ulao

unread,
Sep 18, 2021, 5:02:41 PMSep 18
to LUFA Library Support List

I think I needs something like this

void EVENT_USB_Device_ControlRequest(void)
{

if (USB_ControlRequest.wValue == 0x0301 && USB_ControlRequest.bRequest == 6)
        {
            XData[0] = 1;
            XData[1] = 3;
            XData[2] = 0x0e;
                        
            while ( !Endpoint_IsINReady() );   Endpoint_Write_Stream_LE( &XData, sizeof(XData), NULL);
        }
Endpoint_ClearOUT();
}


I also tried setting a flag and doing
Endpoint_Write_Stream_LE( &XData, sizeof(XData), NULL);
in the normal hid task but the timing is way off..



The reason I want to do this is because of xinput, they use some proprietary crap.

I see it sends an Out bulk transfer with  1,3,6 and then an bulk in transfer answered it. Though I'm pretty sure the answer needs to be the next transfer after the out. I can not seem to get LUFA to stack them. This handshake happens jut after enumeration. and what I see is the out transfer and then a lot of in transfer (like normal ) followed by the in transfer I need.

What i want..

 1,3,6 out
 1 3 0 in

but instead get.

 1,3,6 out
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
... and many more
.. and more
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
 1 3 0 in finally my custom transfer

I was hoping putting the Endpoint_Write_Stream_LE in the EVENT_USB_Device_ControlRequest itself would have worked but it didn't.

















ulao

unread,
Sep 18, 2021, 5:58:18 PMSep 18
to LUFA Library Support List
changin the code to

            while ( !Endpoint_IsINReady() ); 
            Endpoint_SelectEndpoint(EPNUM1);
            Endpoint_Write_Stream_LE( &XData, sizeof(XData), NULL);
            Endpoint_ClearIN();

made it work but again, just much to late. I need to get this data set to go out as soon as I received the in.

This is what I see with xinput

trans.png

ulao

unread,
Sep 19, 2021, 12:05:43 AMSep 19
to LUFA Library Support List
Also I think maybe my issues is that the xinput has 3 isochronouse pipes.

1 in
1 out
2 in
2 out
3 in
3 out

but how do I set that up?

        Endpoint_ConfigureEndpoint((ENDPOINT_DIR_IN | EPNUM1), EP_TYPE_INTERRUPT, 32, EP_TYPE_ISOCHRONOUS);
        Endpoint_ConfigureEndpoint((ENDPOINT_DIR_IN | EPNUM2), EP_TYPE_INTERRUPT, 32, EP_TYPE_ISOCHRONOUS);
        Endpoint_ConfigureEndpoint((ENDPOINT_DIR_IN | EPNUM3), EP_TYPE_INTERRUPT, 32, EP_TYPE_ISOCHRONOUS);
       
there is no address for both (its 80 or 0), and compiling 6 change configs gums it all up.

ulao

unread,
Sep 19, 2021, 9:28:58 PMSep 19
to LUFA Library Support List
This can be ignored, the config descriptor I used was the issue.
Reply all
Reply to author
Forward
0 new messages