dsremap icon indicating copy to clipboard operation
dsremap copied to clipboard

Upgrade LUFA to modern alternative?

Open bsperryn opened this issue 4 years ago • 8 comments

Hello, unfortunately LUFA only supports older AVR boards.

How about something like https://github.com/NicoHood/HID or https://github.com/hathach/tinyusb so that it would be compatible with modern boards?

bsperryn avatar Mar 30 '21 09:03 bsperryn

My first prototypes used the HID library but it quickly became clear it doesn't allow the kind of low-level USB access I need to trick the PS4. I'll take a look at tinyusb.

fraca7 avatar Mar 30 '21 09:03 fraca7

I'll also keep digging around and see whether I can find any other alternatives.

bsperryn avatar Mar 30 '21 10:03 bsperryn

I can't seem to find anything else, please let me know if there is anything I can do to help.

bsperryn avatar Mar 31 '21 14:03 bsperryn

https://github.com/arduino/ArduinoCore-samd/blob/master/cores/arduino/USB/USBAPI.h#L67

This is low level enough? I believe the Nico/HID library is using this under the hood for the Samd boards and something similar for the other boards.

bsperryn avatar Mar 31 '21 21:03 bsperryn

It is, but it's also badly designed and next to impossible to extend or use in "advanced" situations. LUFA on the other hand enables the user to do pretty much anything with its callback-based API. I'm hoping tinyusb follows the same philosophy.

fraca7 avatar Apr 01 '21 07:04 fraca7

Could you tell me what functionality is missing in the USBAPI that's needed for your library?

I've been having a problem getting TinyUsb to work with my board.

In combination with the HID library I'm thinking of recreating the LUFA interface, but using the Arduino USBAPI under the hood. That way your code wouldn't need any dramatic changes.

Could you tell which which LUFA functionality this library is using and in which files so that I can recreate the LUFA interface?

bsperryn avatar Apr 04 '21 08:04 bsperryn

I use basically all of the low-level device (not host) USB APIs. At first I tried using the Arduino built-in USB code but it didn't have some of the core functionality I needed, so I doubt you can do that. It would probably be simpler to implement a driver for your board directly in LUFA (http://www.fourwalledcubicle.com/files/LUFA/Doc/210130/html/_page__writing_board_drivers.html) or maybe add support for your board in the Arduino LUFA project (https://github.com/Palatis/Arduino-Lufa) wouldn't it ?

fraca7 avatar Apr 04 '21 14:04 fraca7

Yes, you're probably right. It does seem fairly daunting to me since I've never done anything like that before, but I guess that's probably what needs to be done!

bsperryn avatar Apr 04 '21 21:04 bsperryn