JonnyHaystack / HayBox

Modular cross-platform firmware for digital or mixed analog/digital game controllers
GNU General Public License v3.0
166 stars 168 forks source link

Create initial B0XX R4 config #26

Closed ribbanya closed 6 months ago

ribbanya commented 1 year ago

Uses pico as a base. Face buttons are confirmed but I did not attempt to get nunchuk or keyboard modes working.

JonnyHaystack commented 1 year ago

Hey, sorry for taking so long to look over this. The button pins look good. You should be able to quickly figure out the joybus data pin by trial and error. Seeing as you know it can't be any of the face buttons, the only pins to try are GP0 through GP5, so that should be really quick.

Once you've figured that out, you could then try and figure out which pin gets toggled when you hold the Brook button hold on plugin with the official firmware, and you'll only have 5 pins to check for that.

As for Nunchuk, that uses i2c so you know it has to use a pair of SDA and SCL pins marked on the Pico pinout diagram below, and they both have to be on the same i2c instance (i.e. if the SDA pin is on I2C0, the other must be as well). That leaves you with only a couple of options that it could possibly be.

Keyboard modes should work out of the box, but they don't work with XInputBackend so you just have to hold Z on plugin and then you can press the button combo to enter a keyboard mode.

avahe-kellenberger commented 1 year ago

@ribbanya any progress on this? I'm about to receive my R4, and will probably continue the work from this PR once it arrives (unless you are going to finish this soonish)

ribbanya commented 1 year ago

Feel free to pick it up. It's feature-complete for my purposes, just missing the aforementioned functionality.

You can either create a new PR that supersedes this one, or you can PR my PR, up to you.

ribbanya commented 1 year ago

@JonnyHaystack Any tips on what would be necessary to get keyboard mode working? It might be a Linux issue, but it doesn't seem to work with the default keyboard mode for me.

Nevermind, I reread https://github.com/JonnyHaystack/HayBox/pull/26#issuecomment-1361748183 and it's working with Dinput. Sorry for the ping.

avahe-kellenberger commented 1 year ago

Btw the joybus data pin is 2, just tested it on my fork.