Project-Alpaca / Alpaca-FW

Teensyduino-based firmware for Alpaca project
13 stars 0 forks source link

Possible to make this for atmega32u4 board? #1

Closed kuwoh closed 5 years ago

kuwoh commented 6 years ago

is it possible to make this for something like an arduino leonardo (emulate a ds4 controller for making a fightstick)

dogtopus commented 6 years ago

In theory yes it is possible, but it would require some heavy patching to Leonardo's Arduino standard library to get rid of the built-in USB CDC serial interface, because otherwise the serial interface will use the endpoints required by the DS4 (ep 3 and 4) and it is not overridable on the PluggableUSB side. Besides that, the DS4 emulation part in this codebase has hard dependencies to low level features of the teensy3 standard library so it would be tricky to port it to Arduino PluggableUSB or even teensy{,++}

So no it is not happening on this codebase. I am, however, planning to write a library that invokes the console-to-USB-serial portion of GIMX adapter on the Arduino via UART so that it provides a base for platform-independent DS4 (and maybe even other USB controllers) emulation.

kuwoh commented 6 years ago

I do have a firmware that you flash so it can be an xinput controller

dogtopus commented 6 years ago

Well it doesn't really matter. The DS4 emulation part will be done directly on the Arduino so the Arduino encodes the button presses, etc. natively to the same format DS4 uses. The adapter is only responsible for sending data to and receiving data from the PS4

kuwoh commented 6 years ago

off topic: mind telling me more about the B***k boards? or do you have somekind of source about them?

dogtopus commented 6 years ago

http://www.brookaccessory.com/detail/06960737/

True that if you are just a normal user (or just don't want to spend a lot of time hacking hardware/firmware) and want to make a controller no more complex than a fightstick and expect it to work everywhere, this is for you.

I'll close this issue for now since there's currently no plan to port this to platforms other than teensy3.

dogtopus commented 5 years ago

Turns out that I was wrong. Endpoint 3 and 4 are not a requirement for emulating a licensed controller. So PluggableUSB backend on a compatible microcontroller, say ATmega32u4 or ATSAM series, without performing heavy hacks on the Arduino library actually sounds possible.

However I need to do some cleanup first in order to make this happen. Namely make the DS4 emulation code a library and make it an abstraction layer on top of some backend code (e.g. teensy library hack, Arduino PluggableUSB, something for STM32, etc.)

dogtopus commented 5 years ago

See dogtopus/RDS4Reboot#1