dangiu / PicoMemcard

Emulating PSX Memory Card (or controller) using a Raspberry Pi Pico
GNU General Public License v3.0
529 stars 38 forks source link

QTPY RP2040 Support, adjustments to better support multiple boards #19

Open qxc86 opened 1 year ago

qxc86 commented 1 year ago

This is my first pull request and my first time doing anything in C. Please feel free to point out any mistakes, and sorry for hacking away at your code.

The Adafruit QTPY RP2040 is tested and working with these changes, with the exception of the LED. I can't for the life of me figure out why it's not working. I want to make sure that the current code is still working on the RP2040 Zero, and I have one due in later this week.

Also made other changes so that the target board can be set with -DPICO_BOARD=. This is the same flag used by pico-sdk to set default pins and other tidbits per board. More info about that and the various board names here.

TODOs include fixing the LED, confirming nothing is broke on Pico or Waveshare_RP2040_Zero, and making a nice svg pinout picture. I don't know how to do that, but I do have a crude text layout.

PS CARD                            SD CARD
Inputs on left                Pins on right

And DET, optional.          And power input
                 ________________
                / QT          PY \
            CLK o GP29       5V  o
            SEL o GP28       GND o GND
            CMD o GP27       3.3 o 3.3V
            DAT o GP26       GP3 o MOSI / SI
            ACK o GP24       GP4 o MISO / SO
                o GP25       GP6 o SCK / CLK 
            DET o_GP20_______GP5_o SS / CS 

             LED   GP12
           LED PWR GP11

I also couldn't find where the DET pin was used in the code. In the future I'd like to add the option to use buttons on the GPIO to change MC images since the PS2 doesn't currently support the controller button combo, to my knowledge. The qtpy 2040 is a bit short on pins so having an extra one free would be nice.

Thanks!

qxc86 commented 1 year ago

Confirmed LED functionality also broken on the rp2040-zero, I need to fix that before this gets pulled.

qxc86 commented 1 year ago

Dug a bit more today and realized that the LED is not working on the RP2040-Zero even when I build from the current pmc+/release branch. Going to open up an issue on that as it doesn't seem to be related to my changes.