diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index b430e08cf..abbd1a63c 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - GP2040_BOARDCONFIG: [ARCController, Blank, Pico, PicoW, BentoBox, ergoSHIFTRev2, FightboardV3, FightboardV3Mirrored, FlatboxRev4, FlatboxRev5, FlatboxRev5RGB, FlatboxRev5USBPassthrough, FlatboxRev5Southpaw, Granola, KB2040, KeyboardConverter, Haute42COSMOX, Liatris, MavercadeRev1, MavercadeRev2, MiSTercadeV2, OpenCore0, OpenCore0WASD, PicoAnn, PicoFightingBoard, RanaTadpole, ReflexCtrlGenesis6, ReflexCtrlNES, ReflexCtrlSaturn, ReflexCtrlSNES, ReflexCtrlVB, ReflexEncodeV1.2, ReflexEncodeV2.0, RP2040AdvancedBreakoutBoard, RP2040AdvancedBreakoutBoardUSBPassthrough, RP2040MiniBreakoutBoard, SparkFunProMicro, WaveshareZero, Stress, SGFDevices, ZeroRhythm] + GP2040_BOARDCONFIG: [ARCController, Blank, Pico, PicoW, BentoBox, ergoSHIFTRev2, FightboardV3, FightboardV3Mirrored, FlatboxRev4, FlatboxRev5, FlatboxRev5RGB, FlatboxRev5USBPassthrough, FlatboxRev5Southpaw, Granola, KB2040, KeyboardConverter, Haute42COSMOX, Liatris, MavercadeRev1, MavercadeRev2, MiSTercadeV2, OpenCore0, OpenCore0WASD, OSUMGP-RP2040, PicoAnn, PicoFightingBoard, PXPGamepad, RanaTadpole, ReflexCtrlGenesis6, ReflexCtrlNES, ReflexCtrlSaturn, ReflexCtrlSNES, ReflexCtrlVB, ReflexEncodeV1.2, ReflexEncodeV2.0, RP2040AdvancedBreakoutBoard, RP2040AdvancedBreakoutBoardUSBPassthrough, RP2040MiniBreakoutBoard, SparkFunProMicro, WaveshareZero, Stress, SGFDevices, ZeroRhythm] steps: #Global Setup diff --git a/CMakeLists.txt b/CMakeLists.txt index 825935a43..6a8a229c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,11 +18,16 @@ execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --always --dirty WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_VARIABLE GIT_REPO_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${GIT_EXECUTABLE} describe --always --abbrev=7 + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + OUTPUT_VARIABLE GIT_REPO_BUILD_ID + OUTPUT_STRIP_TRAILING_WHITESPACE) string(REGEX REPLACE "v([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" CMAKE_GIT_REPO_VERSION ${GIT_REPO_VERSION}) string(REGEX REPLACE "^(.......-.*)|(.......)$" "0.0.0" CMAKE_GIT_REPO_VERSION ${CMAKE_GIT_REPO_VERSION}) # fix if all we have is the git SHA configure_file("headers/version.h.in" "headers/version.h") message("GIT_REPO_VERSION is ${GIT_REPO_VERSION}") message("CMAKE_GIT_REPO_VERSION is ${CMAKE_GIT_REPO_VERSION}") +message("GIT_REPO_BUILD_ID is ${GIT_REPO_BUILD_ID}") # Uncomment the next line for an unomptimized build for debugging. Use in conjunction with the Debug build type. # set(PICO_DEOPTIMIZED_DEBUG 1) @@ -187,6 +192,8 @@ src/display/ui/elements/GPSprite.cpp src/display/ui/screens/ButtonLayoutScreen.cpp src/display/ui/screens/ConfigScreen.cpp src/display/ui/screens/MainMenuScreen.cpp +src/display/ui/screens/PinViewerScreen.cpp +src/display/ui/screens/StatsScreen.cpp src/display/ui/screens/SplashScreen.cpp src/display/GPGFX.cpp src/display/GPGFX_UI.cpp @@ -215,6 +222,7 @@ src/addons/display.cpp src/addons/neopicoleds.cpp src/addons/playernum.cpp src/addons/playerleds.cpp +src/addons/reactiveleds.cpp src/addons/rotaryencoder.cpp src/addons/reverse.cpp src/addons/drv8833_rumble.cpp diff --git a/configs/ARCController/README.md b/configs/ARCController/README.md index c18acb160..c61ea8034 100644 --- a/configs/ARCController/README.md +++ b/configs/ARCController/README.md @@ -1,3 +1,26 @@ # GP2040 Configuration for the ARC Accessibility Controller ![ARC Accessibility Controller](assets/ARC%20Accessibility%20Controller%201.JPG) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | \ No newline at end of file diff --git a/configs/BentoBox/Readme.md b/configs/BentoBox/Readme.md index b53376454..59ca482dd 100644 --- a/configs/BentoBox/Readme.md +++ b/configs/BentoBox/Readme.md @@ -2,7 +2,7 @@ ![ScrubTier logo](assets/ScrubTier_Large.png) -Configuration for the [ScrubTier BentoBox v1 and v2 as well as the GGEZStick Keebfighters](https://https://scrubtier.co.uk/). The ScrubTier BentoBox v1 and v2 are based on the [Flatbox](https://github.com/jfedor2/flatbox) design by [jfedor2](https://github.com/jfedor2). The BentoBox BentoBox v1 uses a Raspberry Pi Pico and the BentoBox v2 as well as the GGEZStick have an embedded RP2040. +Configuration for the [ScrubTier BentoBox v1 and v2 as well as the GGEZStick Keebfighters](https://scrubtier.co.uk/). The ScrubTier BentoBox v1 and v2 are based on the [Flatbox](https://github.com/jfedor2/flatbox) design by [jfedor2](https://github.com/jfedor2). The BentoBox BentoBox v1 uses a Raspberry Pi Pico and the BentoBox v2 as well as the GGEZStick have an embedded RP2040. BentoBox v1 - Check it out [here](https://scrubtier.co.uk/products/bentobox) ![BentoBox v1](assets/ST_BentoBoxV1.png) @@ -11,4 +11,27 @@ BentoBox v2 - Check it out [here](https://scrubtier.co.uk/products/bentobox-v2) ![BentoBox v2](assets/ST_BentoBoxV2.png) GGEZStick - Check it out [here](https://scrubtier.co.uk/products/ggez-stick) -![GGEZStick](assets/ST_GGEZStick.png) \ No newline at end of file +![GGEZStick](assets/ST_GGEZStick.png) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/FightboardV3/README.md b/configs/FightboardV3/README.md index df11003ad..21b4392c7 100644 --- a/configs/FightboardV3/README.md +++ b/configs/FightboardV3/README.md @@ -4,3 +4,25 @@ This configuration is for the Fightboard v3 using the Waveshare RP2040 Zero. +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/FightboardV3Mirrored/README.md b/configs/FightboardV3Mirrored/README.md index 5661f6390..10aecdc23 100644 --- a/configs/FightboardV3Mirrored/README.md +++ b/configs/FightboardV3Mirrored/README.md @@ -4,3 +4,25 @@ This configuration is for the mirrored version of the Fightboard v3 using the Waveshare RP2040 Zero. +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/FlatboxRev4/Readme.md b/configs/FlatboxRev4/Readme.md index 05514adb3..a05445563 100644 --- a/configs/FlatboxRev4/Readme.md +++ b/configs/FlatboxRev4/Readme.md @@ -4,4 +4,27 @@ Configuration for the [Flatbox Rev 4](https://github.com/jfedor2/flatbox/tree/master/hardware-rev4), one of the excellent revisions of the [Flatbox](https://github.com/jfedor2/flatbox) design by [jfedor2](https://github.com/jfedor2) powered by an RP2040 MCU. -![Layout](assets/ButtonMapping.png) \ No newline at end of file +![Layout](assets/ButtonMapping.png) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_24| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_25| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/FlatboxRev5/Readme.md b/configs/FlatboxRev5/Readme.md index 4b16ade95..e5f1167a6 100644 --- a/configs/FlatboxRev5/Readme.md +++ b/configs/FlatboxRev5/Readme.md @@ -3,3 +3,26 @@ ![Flatbox rev5](assets/Flatbox-rev5.jpg) Configuration for the [Flatbox rev5](https://github.com/jfedor2/flatbox/tree/master/hardware-rev5), a variant of the [Flatbox](https://github.com/jfedor2/flatbox) design by [jfedor2](https://github.com/jfedor2). This revision uses an RP2040-Zero board. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/FlatboxRev5RGB/Readme.md b/configs/FlatboxRev5RGB/Readme.md index df4380922..c2e3bde5f 100644 --- a/configs/FlatboxRev5RGB/Readme.md +++ b/configs/FlatboxRev5RGB/Readme.md @@ -3,3 +3,26 @@ ![Flatbox rev5](assets/Flatbox-rev5-rgb.jpg) Configuration for the [Flatbox rev5 RGB](https://github.com/OpenStickCommunity/Hardware/tree/main/Boards/GP2040-CE%20Official%20Controllers/Flatbox%20Rev%205%20RGB), a variant of the [Flatbox](https://github.com/jfedor2/flatbox) design by [jfedor2](https://github.com/jfedor2). This revision uses an RP2040-Zero board and introduces RGB LEDs for buttons and players. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/FlatboxRev5Southpaw/BoardConfig.h b/configs/FlatboxRev5Southpaw/BoardConfig.h index 29babeb66..5b457d585 100644 --- a/configs/FlatboxRev5Southpaw/BoardConfig.h +++ b/configs/FlatboxRev5Southpaw/BoardConfig.h @@ -33,15 +33,6 @@ #define GPIO_PIN_02 GpioAction::BUTTON_PRESS_A1 // A1 | Guide | Home | PS | 13 | ~ | #define GPIO_PIN_05 GpioAction::BUTTON_PRESS_A2 // A2 | ~ | Capture | ~ | 14 | ~ | -// Setting GPIO pins to assigned by add-on -// -#define GPIO_PIN_00 GpioAction::ASSIGNED_TO_ADDON -#define GPIO_PIN_11 GpioAction::ASSIGNED_TO_ADDON -#define GPIO_PIN_24 GpioAction::ASSIGNED_TO_ADDON -#define GPIO_PIN_25 GpioAction::ASSIGNED_TO_ADDON -#define GPIO_PIN_26 GpioAction::ASSIGNED_TO_ADDON -#define GPIO_PIN_27 GpioAction::ASSIGNED_TO_ADDON - // Keyboard Mapping Configuration // // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | #define KEY_DPAD_UP HID_KEY_ARROW_UP // UP | UP | UP | UP | UP | UP | diff --git a/configs/FlatboxRev5Southpaw/Readme.md b/configs/FlatboxRev5Southpaw/Readme.md index a5f538226..9d73d7524 100644 --- a/configs/FlatboxRev5Southpaw/Readme.md +++ b/configs/FlatboxRev5Southpaw/Readme.md @@ -3,3 +3,26 @@ ![Flatbox rev5](assets/Flatbox-rev5.jpg) Configuration for the [Flatbox rev5-southpaw](https://github.com/SkylaHila/flatbox-southpaw), a variant of the [Flatbox](https://github.com/jfedor2/flatbox) design by [jfedor2](https://github.com/jfedor2). This revision uses an RP2040-Zero board. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/FlatboxRev5USBPassthrough/Readme.md b/configs/FlatboxRev5USBPassthrough/Readme.md index 7e71675fd..6ac2ddff5 100644 --- a/configs/FlatboxRev5USBPassthrough/Readme.md +++ b/configs/FlatboxRev5USBPassthrough/Readme.md @@ -3,3 +3,26 @@ ![Flatbox rev5 USB Passthrough](assets/Flatbox-rev5-USB-Passthrough.jpg) Configuration for the [Flatbox rev5 USB Passthrough](https://github.com/jfedor2/flatbox/tree/master/hardware-rev5), a variant of the [Flatbox Rev 5](https://github.com/jfedor2/flatbox/tree/master/hardware-rev5) design by [jfedor2](https://github.com/jfedor2). + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/FlatboxRev5USBPassthrough/assets/Flatbox-rev5-USB-Passthrough.jpg b/configs/FlatboxRev5USBPassthrough/assets/Flatbox-rev5-USB-Passthrough.jpg index 427a7d105..ed7405309 100644 Binary files a/configs/FlatboxRev5USBPassthrough/assets/Flatbox-rev5-USB-Passthrough.jpg and b/configs/FlatboxRev5USBPassthrough/assets/Flatbox-rev5-USB-Passthrough.jpg differ diff --git a/configs/Granola/Readme.md b/configs/Granola/Readme.md index db45834fd..c4de58e5e 100644 --- a/configs/Granola/Readme.md +++ b/configs/Granola/Readme.md @@ -3,3 +3,26 @@ ![Granola Arcade Logo](assets/granola-logo.png) Configuration for [Granola Arcade](https://granola.games) controllers. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/Haute42COSMOX/README.md b/configs/Haute42COSMOX/README.md index 531df54a8..41e051b8a 100644 --- a/configs/Haute42COSMOX/README.md +++ b/configs/Haute42COSMOX/README.md @@ -18,3 +18,26 @@ Haute42 G Series including the G12, G13 and G16 - Check it out [here](https://ha Haute42 Mini Sieres inclusing the Mini and DIY Mini ket - Check it out [here](https://haute42.com/haute-board-mini/) ![Haute42 Mini Series](assets/Haute42_Mini_series.png) ![Haute42 Mini](assets/Haute42_Mini.png) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/KB2040/README.md b/configs/KB2040/README.md index 71ff5568e..d6581986c 100644 --- a/configs/KB2040/README.md +++ b/configs/KB2040/README.md @@ -3,3 +3,26 @@ ![Pin Mapping](assets/PinMapping.png) Basic pin setup for a Raspberry Pi Pico based Adafruit KB2040. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/KeyboardConverter/README.md b/configs/KeyboardConverter/README.md index 39da1aa80..6323234b8 100644 --- a/configs/KeyboardConverter/README.md +++ b/configs/KeyboardConverter/README.md @@ -5,4 +5,27 @@ Basic pin setup for the Waveshare RP2040 Zero based Keyboard Converter. The embedded version of the Keyboard converter uses the same pinout for the RP2040 as the Waveshare -RP2040 Zero \ No newline at end of file +RP2040 Zero + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/Liatris/README.md b/configs/Liatris/README.md index aaf3d321f..4ffda84e4 100644 --- a/configs/Liatris/README.md +++ b/configs/Liatris/README.md @@ -3,3 +3,26 @@ ![Pin Mapping](assets/Liatris.png) Basic pin setup for a stock [Liatris](https://splitkb.com/products/liatris). + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_23| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/MavercadeRev1/Readme.md b/configs/MavercadeRev1/Readme.md index 1a8ee71ab..4d6512eaa 100644 --- a/configs/MavercadeRev1/Readme.md +++ b/configs/MavercadeRev1/Readme.md @@ -14,4 +14,27 @@ Mavercade Keebfighter 01 - Check it out [here](https://mavercade.com/products/ma ![Mavercade Keebfighter 01](assets/keebfighter-01.png) Mavercade Keebfighter 02 - Check it out [here](https://mavercade.com/products/mavercade-keebfighter-02) -![Mavercade Keebfighter 02](assets/keebfighter-02.png) \ No newline at end of file +![Mavercade Keebfighter 02](assets/keebfighter-02.png) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/MavercadeRev2/Readme.md b/configs/MavercadeRev2/Readme.md index dab95ab85..12e145a14 100644 --- a/configs/MavercadeRev2/Readme.md +++ b/configs/MavercadeRev2/Readme.md @@ -6,4 +6,28 @@ Configuration for the [Mavercade Keebfighter S3+ and S4+](https://mavercade.com/ Mavercade Keebfighter S3+ - Check it out [here](https://mavercade.com/products/mavercade-keebfighter-s3) Mavercade Keebfighter S4+ - Check it out [here](https://mavercade.com/products/mavercade-keebfighter-s4) -![Mavercade Keebfighter S3+ and S4+](assets/Rev2_config_pic.jpg) \ No newline at end of file +![Mavercade Keebfighter S3+ and S4+](assets/Rev2_config_pic.jpg) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_23| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_24| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/MiSTercadeV2/README.md b/configs/MiSTercadeV2/README.md index a42fade7c..a394101c6 100644 --- a/configs/MiSTercadeV2/README.md +++ b/configs/MiSTercadeV2/README.md @@ -16,3 +16,29 @@ Features Purchase: https://misteraddons.com/products/mistercade-v2-kit-mister-fpga-jamma-arcade-kit GitHub: https://github.com/misteraddons/MiSTercade-Config + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_E1 | Twin Stick Up +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_E2 | Twin Stick Down +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_E3 | Twin Stick Left +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_E4 | Twin Stick Right +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_E4 | Player 2 Start \ No newline at end of file diff --git a/configs/MiSTercadeV2/assets/MistercadeV2.jpg b/configs/MiSTercadeV2/assets/MistercadeV2.jpg index 68e011287..83fcf6b14 100644 Binary files a/configs/MiSTercadeV2/assets/MistercadeV2.jpg and b/configs/MiSTercadeV2/assets/MistercadeV2.jpg differ diff --git a/configs/OSUMGP-RP2040/BoardConfig.h b/configs/OSUMGP-RP2040/BoardConfig.h new file mode 100644 index 000000000..392b1b0c6 --- /dev/null +++ b/configs/OSUMGP-RP2040/BoardConfig.h @@ -0,0 +1,99 @@ +/* + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: Copyright (c) 2024 OpenStickCommunity (gp2040-ce.info) + */ + +#ifndef PICO_BOARD_CONFIG_H_ +#define PICO_BOARD_CONFIG_H_ + +#include "enums.pb.h" +#include "class/hid/hid.h" + +#define BOARD_CONFIG_LABEL "OSUMGP-RP2040" + +// Main pin mapping configuration +// // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +#define GPIO_PIN_17 GpioAction::BUTTON_PRESS_UP // UP | UP | UP | UP | UP | UP | +#define GPIO_PIN_13 GpioAction::BUTTON_PRESS_DOWN // DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +#define GPIO_PIN_14 GpioAction::BUTTON_PRESS_RIGHT // RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +#define GPIO_PIN_16 GpioAction::BUTTON_PRESS_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +#define GPIO_PIN_09 GpioAction::BUTTON_PRESS_B1 // B1 | A | B | Cross | 2 | K1 | +#define GPIO_PIN_08 GpioAction::BUTTON_PRESS_B2 // B2 | B | A | Circle | 3 | K2 | +#define GPIO_PIN_07 GpioAction::BUTTON_PRESS_R2 // R2 | RT | ZR | R2 | 8 | K3 | +#define GPIO_PIN_18 GpioAction::BUTTON_PRESS_L2 // L2 | LT | ZL | L2 | 7 | K4 | +#define GPIO_PIN_06 GpioAction::BUTTON_PRESS_B3 // B3 | X | Y | Square | 1 | P1 | +#define GPIO_PIN_05 GpioAction::BUTTON_PRESS_B4 // B4 | Y | X | Triangle | 4 | P2 | +#define GPIO_PIN_03 GpioAction::BUTTON_PRESS_R1 // R1 | RB | R | R1 | 6 | P3 | +#define GPIO_PIN_21 GpioAction::BUTTON_PRESS_L1 // L1 | LB | L | L1 | 5 | P4 | +#define GPIO_PIN_22 GpioAction::BUTTON_PRESS_S1 // S1 | Back | Minus | Select | 9 | Coin | +#define GPIO_PIN_02 GpioAction::BUTTON_PRESS_S2 // S2 | Start | Plus | Start | 10 | Start | +#define GPIO_PIN_19 GpioAction::BUTTON_PRESS_L3 // L3 | LS | LS | L3 | 11 | LS | +#define GPIO_PIN_10 GpioAction::BUTTON_PRESS_R3 // R3 | RS | RS | R3 | 12 | RS | +#define GPIO_PIN_15 GpioAction::BUTTON_PRESS_A1 // A1 | Guide | Home | PS | 13 | ~ | +#define GPIO_PIN_20 GpioAction::BUTTON_PRESS_A2 // A2 | ~ | Capture | ~ | 14 | ~ | + + +// Setting GPIO pins to assigned by add-on +// +#define GPIO_PIN_00 GpioAction::ASSIGNED_TO_ADDON // I2C SDA +#define GPIO_PIN_01 GpioAction::ASSIGNED_TO_ADDON // I2C SCL +#define GPIO_PIN_11 GpioAction::ASSIGNED_TO_ADDON // USB D+ +#define GPIO_PIN_12 GpioAction::ASSIGNED_TO_ADDON // USB D- +#define GPIO_PIN_25 GpioAction::ASSIGNED_TO_ADDON // On-board LED +#define GPIO_PIN_26 GpioAction::ASSIGNED_TO_ADDON // ADC1 X +#define GPIO_PIN_27 GpioAction::ASSIGNED_TO_ADDON // ADC2 X +#define GPIO_PIN_28 GpioAction::ASSIGNED_TO_ADDON // ADC1 Y +#define GPIO_PIN_29 GpioAction::ASSIGNED_TO_ADDON // ADC2 Y + + +// Keyboard mapping configuration +// // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +#define KEY_DPAD_UP HID_KEY_ARROW_UP // UP | UP | UP | UP | UP | UP | +#define KEY_DPAD_DOWN HID_KEY_ARROW_DOWN // DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +#define KEY_DPAD_RIGHT HID_KEY_ARROW_RIGHT // RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +#define KEY_DPAD_LEFT HID_KEY_ARROW_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +#define KEY_BUTTON_B1 HID_KEY_SHIFT_LEFT // B1 | A | B | Cross | 2 | K1 | +#define KEY_BUTTON_B2 HID_KEY_Z // B2 | B | A | Circle | 3 | K2 | +#define KEY_BUTTON_R2 HID_KEY_X // R2 | RT | ZR | R2 | 8 | K3 | +#define KEY_BUTTON_L2 HID_KEY_V // L2 | LT | ZL | L2 | 7 | K4 | +#define KEY_BUTTON_B3 HID_KEY_CONTROL_LEFT // B3 | X | Y | Square | 1 | P1 | +#define KEY_BUTTON_B4 HID_KEY_ALT_LEFT // B4 | Y | X | Triangle | 4 | P2 | +#define KEY_BUTTON_R1 HID_KEY_SPACE // R1 | RB | R | R1 | 6 | P3 | +#define KEY_BUTTON_L1 HID_KEY_C // L1 | LB | L | L1 | 5 | P4 | +#define KEY_BUTTON_S1 HID_KEY_5 // S1 | Back | Minus | Select | 9 | Coin | +#define KEY_BUTTON_S2 HID_KEY_1 // S2 | Start | Plus | Start | 10 | Start | +#define KEY_BUTTON_L3 HID_KEY_EQUAL // L3 | LS | LS | L3 | 11 | LS | +#define KEY_BUTTON_R3 HID_KEY_MINUS // R3 | RS | RS | R3 | 12 | RS | +#define KEY_BUTTON_A1 HID_KEY_9 // A1 | Guide | Home | PS | 13 | ~ | +#define KEY_BUTTON_A2 HID_KEY_F2 // A2 | ~ | Capture | ~ | 14 | ~ | +#define KEY_BUTTON_FN -1 // Hotkey Function | + + +// J4 - I2C +// SparkFun Micro OLED Breakout recommended +#define HAS_I2C_DISPLAY 1 +#define I2C0_ENABLED 1 +#define DISPLAY_I2C_ADDR 0x3D +#define I2C0_PIN_SDA 0 +#define I2C0_PIN_SCL 1 + + +// J3 - USB Passthrough +#define USB_PERIPHERAL_ENABLED 1 +#define USB_PERIPHERAL_PIN_DPLUS 11 +#define USB_PERIPHERAL_PIN_ORDER 0 + + +// On-board LED settings +#define BOARD_LED_ENABLED 1 +#define BOARD_LED_TYPE ON_BOARD_LED_MODE_MODE_INDICATOR + + +// Analog settings +#define ANALOG_INPUT_ENABLED 1 +#define ANALOG_ADC_1_VRX 26 +#define ANALOG_ADC_1_VRY 28 +#define ANALOG_ADC_2_VRX 27 +#define ANALOG_ADC_2_VRY 29 + +#endif \ No newline at end of file diff --git a/configs/OSUMGP-RP2040/Readme.md b/configs/OSUMGP-RP2040/Readme.md new file mode 100644 index 000000000..e445ce0be --- /dev/null +++ b/configs/OSUMGP-RP2040/Readme.md @@ -0,0 +1,28 @@ +# GP2040 Configuration for the OSUMGP-RP2040 + +![OSUMGP-RP2040](assets/osumgp-rp2040_0.4b-real.jpg) + +Configuration for the [OSUMGP-RP2040](https://github.com/NickGuyver/OSUMGP-RP2040). PCB reference design for building a game pad with an embedded RP2040 running GP2040-CE firmware. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/OSUMGP-RP2040/osumgp-rp2040_0.4b-real.jpg b/configs/OSUMGP-RP2040/osumgp-rp2040_0.4b-real.jpg new file mode 100644 index 000000000..0da295c4d Binary files /dev/null and b/configs/OSUMGP-RP2040/osumgp-rp2040_0.4b-real.jpg differ diff --git a/configs/OpenCore0/README.md b/configs/OpenCore0/README.md index 5017d8467..2cf9d0813 100644 --- a/configs/OpenCore0/README.md +++ b/configs/OpenCore0/README.md @@ -16,3 +16,26 @@ Addressible RGB LED order for the Open_Core0 ![LED Order](assets/Open_Core0_LED_order.png) You can find the full Open_Core0 project over on our hardware section [HERE](https://github.com/OpenStickCommunity/Hardware/tree/main/Boards/GP2040-CE%20Official%20Controllers/Open_Core0) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/OpenCore0WASD/README.md b/configs/OpenCore0WASD/README.md index 7a994014e..eb886c6c3 100644 --- a/configs/OpenCore0WASD/README.md +++ b/configs/OpenCore0WASD/README.md @@ -6,4 +6,27 @@ Basic pin setup for the Open_Core0 WASD. ![Pin Mapping](assets/Open_Core0_WASD_pinout.png) -You can find the full Open_Core0 WASD project over on our hardware section [HERE]() \ No newline at end of file +You can find the full Open_Core0 WASD project over on our hardware section [HERE](https://github.com/OpenStickCommunity/Hardware/tree/main/Boards/GP2040-CE%20Official%20Controllers/Open_Core0%20WASD) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/PXPGamepad/BoardConfig.h b/configs/PXPGamepad/BoardConfig.h new file mode 100644 index 000000000..f5e3f5c8b --- /dev/null +++ b/configs/PXPGamepad/BoardConfig.h @@ -0,0 +1,79 @@ +/* + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: Copyright (c) 2024 OpenStickCommunity (gp2040-ce.info) + */ + +#ifndef PXPGAMEPAD_CONFIG_H_ +#define PXPGAMEPAD_CONFIG_H_ + +#include "enums.pb.h" +#include "class/hid/hid.h" + +#define BOARD_CONFIG_LABEL "PXP-Gamepad" + +// Main pin mapping Configuration +// // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +#define GPIO_PIN_02 GpioAction::BUTTON_PRESS_UP // UP | UP | UP | UP | UP | UP | +#define GPIO_PIN_03 GpioAction::BUTTON_PRESS_DOWN // DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +#define GPIO_PIN_04 GpioAction::BUTTON_PRESS_RIGHT // RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +#define GPIO_PIN_01 GpioAction::BUTTON_PRESS_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +#define GPIO_PIN_11 GpioAction::BUTTON_PRESS_B1 // B1 | A | B | Cross | 2 | K1 | +#define GPIO_PIN_13 GpioAction::BUTTON_PRESS_B2 // B2 | B | A | Circle | 3 | K2 | +#define GPIO_PIN_15 GpioAction::BUTTON_PRESS_R2 // R2 | RT | ZR | R2 | 8 | K3 | +#define GPIO_PIN_00 GpioAction::BUTTON_PRESS_L2 // L2 | LT | ZL | L2 | 7 | K4 | +#define GPIO_PIN_12 GpioAction::BUTTON_PRESS_B3 // B3 | X | Y | Square | 1 | P1 | +#define GPIO_PIN_14 GpioAction::BUTTON_PRESS_B4 // B4 | Y | X | Triangle | 4 | P2 | +#define GPIO_PIN_06 GpioAction::BUTTON_PRESS_R1 // R1 | RB | R | R1 | 6 | P3 | +#define GPIO_PIN_05 GpioAction::BUTTON_PRESS_L1 // L1 | LB | L | L1 | 5 | P4 | +#define GPIO_PIN_09 GpioAction::BUTTON_PRESS_S1 // S1 | Back | Minus | Select | 9 | Coin | +#define GPIO_PIN_10 GpioAction::BUTTON_PRESS_S2 // S2 | Start | Plus | Start | 10 | Start | +#define GPIO_PIN_07 GpioAction::BUTTON_PRESS_L3 // L3 | LS | LS | L3 | 11 | LS | +#define GPIO_PIN_08 GpioAction::BUTTON_PRESS_R3 // R3 | RS | RS | R3 | 12 | RS | + +// Keyboard Mapping Configuration +// // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +#define KEY_DPAD_UP HID_KEY_ARROW_UP // UP | UP | UP | UP | UP | UP | +#define KEY_DPAD_DOWN HID_KEY_ARROW_DOWN // DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +#define KEY_DPAD_RIGHT HID_KEY_ARROW_RIGHT // RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +#define KEY_DPAD_LEFT HID_KEY_ARROW_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +#define KEY_BUTTON_B1 HID_KEY_SHIFT_LEFT // B1 | A | B | Cross | 2 | K1 | +#define KEY_BUTTON_B2 HID_KEY_Z // B2 | B | A | Circle | 3 | K2 | +#define KEY_BUTTON_R2 HID_KEY_X // R2 | RT | ZR | R2 | 8 | K3 | +#define KEY_BUTTON_L2 HID_KEY_V // L2 | LT | ZL | L2 | 7 | K4 | +#define KEY_BUTTON_B3 HID_KEY_CONTROL_LEFT // B3 | X | Y | Square | 1 | P1 | +#define KEY_BUTTON_B4 HID_KEY_ALT_LEFT // B4 | Y | X | Triangle | 4 | P2 | +#define KEY_BUTTON_R1 HID_KEY_SPACE // R1 | RB | R | R1 | 6 | P3 | +#define KEY_BUTTON_L1 HID_KEY_C // L1 | LB | L | L1 | 5 | P4 | +#define KEY_BUTTON_S1 HID_KEY_5 // S1 | Back | Minus | Select | 9 | Coin | +#define KEY_BUTTON_S2 HID_KEY_1 // S2 | Start | Plus | Start | 10 | Start | +#define KEY_BUTTON_L3 HID_KEY_EQUAL // L3 | LS | LS | L3 | 11 | LS | +#define KEY_BUTTON_R3 HID_KEY_MINUS // R3 | RS | RS | R3 | 12 | RS | +#define KEY_BUTTON_A1 HID_KEY_9 // A1 | Guide | Home | PS | 13 | ~ | +#define KEY_BUTTON_A2 HID_KEY_F2 // A2 | ~ | Capture | ~ | 14 | ~ | +#define KEY_BUTTON_FN -1 // Hotkey Function | + +// Setting GPIO pins to assigned by add-on +// +#define GPIO_PIN_26 GpioAction::ASSIGNED_TO_ADDON +#define GPIO_PIN_27 GpioAction::ASSIGNED_TO_ADDON +#define GPIO_PIN_28 GpioAction::ASSIGNED_TO_ADDON +#define GPIO_PIN_29 GpioAction::ASSIGNED_TO_ADDON + +// Analog Configuration +// +#define ANALOG_INPUT_ENABLED 1 +#define ANALOG_ADC_1_VRX 27 +#define ANALOG_ADC_1_VRY 26 +#define ANALOG_ADC_1_MODE DPAD_MODE_LEFT_ANALOG +#define ANALOG_ADC_1_INVERT INVERT_X +#define ANALOG_ADC_2_VRX 29 +#define ANALOG_ADC_2_VRY 28 +#define ANALOG_ADC_2_MODE DPAD_MODE_RIGHT_ANALOG +#define ANALOG_ADC_2_INVERT INVERT_X +#define FORCED_CIRCULARITY_ENABLED 0 +#define DEFAULT_INNER_DEADZONE 5 +#define DEFAULT_OUTER_DEADZONE 50 +#define AUTO_CALIBRATE_ENABLED 1 + + +#endif diff --git a/configs/PXPGamepad/README.md b/configs/PXPGamepad/README.md new file mode 100644 index 000000000..985e515fa --- /dev/null +++ b/configs/PXPGamepad/README.md @@ -0,0 +1,24 @@ +# GP2040 Configuration for the PXP-Gamepad + +https://github.com/MegaBitmap/PXP-Gamepad + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | \ No newline at end of file diff --git a/configs/PXPGamepad/pxpgamepad.h b/configs/PXPGamepad/pxpgamepad.h new file mode 100644 index 000000000..527782f94 --- /dev/null +++ b/configs/PXPGamepad/pxpgamepad.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +// ----------------------------------------------------- +// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO +// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES +// ----------------------------------------------------- + + +#ifndef _BOARDS_PXPGAMEPAD_H +#define _BOARDS_PXPGAMEPAD_H + +// For board detection +#define PXPGAMEPAD + +//For crappy crystal +#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER +#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64 +#endif + +// --- UART --- +#ifndef PICO_DEFAULT_UART +#define PICO_DEFAULT_UART 0 +#endif +#ifndef PICO_DEFAULT_UART_TX_PIN +#define PICO_DEFAULT_UART_TX_PIN 0 +#endif +#ifndef PICO_DEFAULT_UART_RX_PIN +#define PICO_DEFAULT_UART_RX_PIN 1 +#endif + +// // no onboard LED + +// no PICO_DEFAULT_WS2812_PIN + +// --- I2C --- +#ifndef PICO_DEFAULT_I2C +#define PICO_DEFAULT_I2C 0 +#endif +#ifndef PICO_DEFAULT_I2C_SDA_PIN +#define PICO_DEFAULT_I2C_SDA_PIN 4 +#endif +#ifndef PICO_DEFAULT_I2C_SCL_PIN +#define PICO_DEFAULT_I2C_SCL_PIN 5 +#endif + +// --- SPI --- +#ifndef PICO_DEFAULT_SPI +#define PICO_DEFAULT_SPI 0 +#endif +#ifndef PICO_DEFAULT_SPI_SCK_PIN +#define PICO_DEFAULT_SPI_SCK_PIN 18 +#endif +#ifndef PICO_DEFAULT_SPI_TX_PIN +#define PICO_DEFAULT_SPI_TX_PIN 19 +#endif +#ifndef PICO_DEFAULT_SPI_RX_PIN +#define PICO_DEFAULT_SPI_RX_PIN 16 +#endif +#ifndef PICO_DEFAULT_SPI_CSN_PIN +#define PICO_DEFAULT_SPI_CSN_PIN 17 +#endif + +// --- FLASH --- + +#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1 + +#ifndef PICO_FLASH_SPI_CLKDIV +#define PICO_FLASH_SPI_CLKDIV 2 +#endif + +#ifndef PICO_FLASH_SIZE_BYTES +#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024) +#endif + +// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads) +#define PICO_SMPS_MODE_PIN 23 + +#ifndef PICO_RP2040_B0_SUPPORTED +#define PICO_RP2040_B0_SUPPORTED 1 +#endif + +#endif diff --git a/configs/Pico/README.md b/configs/Pico/README.md index 2c0a9574b..55f6a7527 100644 --- a/configs/Pico/README.md +++ b/configs/Pico/README.md @@ -3,3 +3,26 @@ ![Pin Mapping](assets/PinMapping.png) Basic pin setup for a stock Raspberry Pi Pico. Combine with a simple GPIO breakout/screw terminal board for an easy DIY arcade stick. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/PicoAnn/README.md b/configs/PicoAnn/README.md index 840b4f171..f4050faad 100644 --- a/configs/PicoAnn/README.md +++ b/configs/PicoAnn/README.md @@ -3,3 +3,26 @@ ![Pin Mapping](assets/PinMapping_PicoAnn.png) Basic pin setup for boards that were running PicoAnn firmware like the Pico Advanced Breakout Board v3.0. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/PicoFightingBoard/README.md b/configs/PicoFightingBoard/README.md index 888311d06..1c0b58b63 100644 --- a/configs/PicoFightingBoard/README.md +++ b/configs/PicoFightingBoard/README.md @@ -7,3 +7,26 @@ Not equipped with turbo. ![Pin Mapping](assets/PicoFightingBoard_v1.1.jpg) Open source board based on the Brook board design: . The board labels are associated with the GP2040 generic labeling. The 20-pin connector, 4-pin connector and screw terminals are button-compatible with the Brook wiring harnesses and button mappings. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/PicoW/README.md b/configs/PicoW/README.md index 2c0a9574b..4136f56ae 100644 --- a/configs/PicoW/README.md +++ b/configs/PicoW/README.md @@ -3,3 +3,26 @@ ![Pin Mapping](assets/PinMapping.png) Basic pin setup for a stock Raspberry Pi Pico. Combine with a simple GPIO breakout/screw terminal board for an easy DIY arcade stick. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/RP2040AdvancedBreakoutBoard/README.md b/configs/RP2040AdvancedBreakoutBoard/README.md index c4d33699e..0ca383300 100644 --- a/configs/RP2040AdvancedBreakoutBoard/README.md +++ b/configs/RP2040AdvancedBreakoutBoard/README.md @@ -5,3 +5,26 @@ Basic pin setup for the RP2040 Advanced Breakout Board. ![Pin Mapping](assets/RP2040AdvancedBreakoutBoard_pinout.png) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/README.md b/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/README.md index da42a512f..001293b6e 100644 --- a/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/README.md +++ b/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/README.md @@ -1,7 +1,30 @@ # GP2040 Configuration for the RP2040 Advanced Breakout Board USB Passthrough Edition -![RP2040 Advanced Breakout Board - USB Passthrough](assets/RP2040 Advanced Breakout Board - Passthrough.jpg) +![RP2040 Advanced Breakout Board - USB Passthrough](assets/RP2040%20Advanced%20Breakout%20Board%20-%20Passthrough.jpg) Basic pin setup for the RP2040 Advanced Breakout Board. ![Pin Mapping](assets/RP2040AdvancedBreakoutBoard_pinout.png) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/assets/RP2040AdvancedBreakoutBoard_pinout.png b/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/assets/RP2040AdvancedBreakoutBoard_pinout.png new file mode 100644 index 000000000..d8bd7b3fc Binary files /dev/null and b/configs/RP2040AdvancedBreakoutBoardUSBPassthrough/assets/RP2040AdvancedBreakoutBoard_pinout.png differ diff --git a/configs/RP2040MiniBreakoutBoard/README.md b/configs/RP2040MiniBreakoutBoard/README.md index b33558a09..ff38e2c04 100644 --- a/configs/RP2040MiniBreakoutBoard/README.md +++ b/configs/RP2040MiniBreakoutBoard/README.md @@ -1,3 +1,26 @@ # GP2040 Configuration for the RP2040 Mini Breakout Board ![RP2040 Arcade Board](assets/RP2040MiniBreakoutBoard.jpg) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/RanaTadpole/README.md b/configs/RanaTadpole/README.md index b48f76736..f1774b769 100644 --- a/configs/RanaTadpole/README.md +++ b/configs/RanaTadpole/README.md @@ -8,4 +8,28 @@ Basic button setup for the Rana Tadpole. ![Buttons](assets/RanaTadpole_buttons.png) GitHub repo for the Tadpole: -https://github.com/rana-sylvatica/rana-tadpole \ No newline at end of file +https://github.com/rana-sylvatica/rana-tadpole + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_FN | Hotkey Function | \ No newline at end of file diff --git a/configs/ReflexCtrlGenesis6/README.md b/configs/ReflexCtrlGenesis6/README.md index f3c6bc51a..a29aecc8a 100644 --- a/configs/ReflexCtrlGenesis6/README.md +++ b/configs/ReflexCtrlGenesis6/README.md @@ -10,3 +10,20 @@ Open source replacement PCB for Sega Genesis controllers Purchase: https://misteraddons.com/products/Reflex-CTRL GitHub: https://github.com/misteraddons/Reflex-CTRL + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | \ No newline at end of file diff --git a/configs/ReflexCtrlNES/README.md b/configs/ReflexCtrlNES/README.md index 1dd0e0910..d554c56d4 100644 --- a/configs/ReflexCtrlNES/README.md +++ b/configs/ReflexCtrlNES/README.md @@ -7,3 +7,16 @@ Open source replacement PCB for Nintendo NES-004 controllers Purchase: https://misteraddons.com/products/Reflex-CTRL GitHub: https://github.com/misteraddons/Reflex-CTRL + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | \ No newline at end of file diff --git a/configs/ReflexCtrlSNES/README.md b/configs/ReflexCtrlSNES/README.md index 1758483eb..8b423b321 100644 --- a/configs/ReflexCtrlSNES/README.md +++ b/configs/ReflexCtrlSNES/README.md @@ -7,3 +7,26 @@ Open source replacement PCB for Nintendo SNES-001 controllers Purchase: https://misteraddons.com/products/Reflex-CTRL GitHub: https://github.com/misteraddons/Reflex-CTRL + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/ReflexCtrlSaturn/README.md b/configs/ReflexCtrlSaturn/README.md index 57b9f87de..ff0824984 100644 --- a/configs/ReflexCtrlSaturn/README.md +++ b/configs/ReflexCtrlSaturn/README.md @@ -10,3 +10,21 @@ Open source replacement PCB for Sega Saturn controllers Purchase: https://misteraddons.com/products/Reflex-CTRL GitHub: https://github.com/misteraddons/Reflex-CTRL + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | \ No newline at end of file diff --git a/configs/ReflexCtrlVB/README.md b/configs/ReflexCtrlVB/README.md index 8582aa51f..ce263d1a6 100644 --- a/configs/ReflexCtrlVB/README.md +++ b/configs/ReflexCtrlVB/README.md @@ -9,3 +9,22 @@ Note: Do not connect any packs to the controller. The USB cable powers the contr Purchase: https://misteraddons.com/products/Reflex-CTRL GitHub: https://github.com/misteraddons/Reflex-CTRL + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | \ No newline at end of file diff --git a/configs/ReflexEncodeV1.2/README.md b/configs/ReflexEncodeV1.2/README.md index f800d2fa3..92696b7c8 100644 --- a/configs/ReflexEncodeV1.2/README.md +++ b/configs/ReflexEncodeV1.2/README.md @@ -11,4 +11,25 @@ Purchase from: https://misteraddons.com/collections/parts/products/reflex-encode MiSTer addons: https://misteraddons.com/ +## Main Pin Mapping Configuration +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/ReflexEncodeV2.0/README.md b/configs/ReflexEncodeV2.0/README.md index a12722b68..bf7862afa 100644 --- a/configs/ReflexEncodeV2.0/README.md +++ b/configs/ReflexEncodeV2.0/README.md @@ -11,4 +11,27 @@ v2.0 adds USB passthrough authentication via GPIO14 (D+) and DPIO15 (D-). GitHub: https://github.com/misteraddons/ReflexFightingBoard/tree/main/boards/Reflex_Encode-V2.0-GP2040-CE-USB_Pass_Auth Purchase from: https://misteraddons.com/collections/parts/products/reflex-encode-fighting-board -MiSTer addons: https://misteraddons.com/ \ No newline at end of file +MiSTer addons: https://misteraddons.com/ + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/SGFDevices/Readme.md b/configs/SGFDevices/Readme.md index c56af2f4e..abad3ea94 100644 --- a/configs/SGFDevices/Readme.md +++ b/configs/SGFDevices/Readme.md @@ -6,3 +6,26 @@ Configuration for [SGF Devices All Button Controllers](https://sgfdevices.com/co ![SGF Controller](https://github.com/OpenStickCommunity/GP2040-CE/blob/main/configs/SGFDevices/assets/SGF_Controller.png) ![SGF Layout](https://github.com/OpenStickCommunity/GP2040-CE/blob/main/configs/SGFDevices/assets/SGF_Layout.png) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_24| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_25| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/SparkFunProMicro/README.md b/configs/SparkFunProMicro/README.md index 294ef6010..083e7ed9d 100644 --- a/configs/SparkFunProMicro/README.md +++ b/configs/SparkFunProMicro/README.md @@ -5,3 +5,24 @@ Basic pin setup for a stock [Sparkfun Pro Micro - RP2040](https://www.sparkfun.com/products/18288). The pin layout is designed to be a drop in replacement for the [Daemonbite Arcade encoder](https://github.com/MickGyver/DaemonBite-Arcade-Encoder). + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_21| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_22| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_23| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/Stress/README.md b/configs/Stress/README.md index 99abf15d4..c3ff99bb2 100644 --- a/configs/Stress/README.md +++ b/configs/Stress/README.md @@ -4,3 +4,25 @@ Configuration for the [Stress Fightpad](https://github.com/GroooveBob/Stress). Configuration uses the same pinout as the Waveshare RP2040 Zero. +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_29| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/WaveshareZero/README.md b/configs/WaveshareZero/README.md index a386d6cb3..d7dce3f41 100644 --- a/configs/WaveshareZero/README.md +++ b/configs/WaveshareZero/README.md @@ -3,3 +3,26 @@ ![Pin Mapping](assets/WaveshareRP2040Zero.png) Basic pin setup for the Waveshare RP2040 Zero. + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle| 4 | P2 | +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_13| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture | ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/ZeroRhythm/README.md b/configs/ZeroRhythm/README.md index fb2e9e245..f1b41612b 100644 --- a/configs/ZeroRhythm/README.md +++ b/configs/ZeroRhythm/README.md @@ -1,28 +1,30 @@ # GP2040 Configuration for the Zero_Rhythm -[Zero Rhythm](Assets/ZeroRhythm%201.jpg) +![Zero Rhythm](Assets/ZeroRhythm%201.jpg) By default the Zero Rhythm is setup to be used on most Switch games. You can remap the left and right WASD cluster to be LS and RS inputs for other games via the web-config. -// Main pin mapping Configuration -// // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | -#define GPIO_PIN_01 GpioAction::BUTTON_PRESS_R2 // R2 | RT | ZR | R2 | 8 | K3 | -#define GPIO_PIN_02 GpioAction::BUTTON_PRESS_B2 // B2 | B | A | Circle | 3 | K2 | -#define GPIO_PIN_03 GpioAction::BUTTON_PRESS_B4 // B4 | Y | X | Triangle | 4 | P2 | -#define GPIO_PIN_04 GpioAction::BUTTON_PRESS_B1 // B1 | A | B | Cross | 2 | K1 | -#define GPIO_PIN_05 GpioAction::BUTTON_PRESS_B3 // B3 | X | Y | Square | 1 | P1 | -#define GPIO_PIN_06 GpioAction::BUTTON_PRESS_R1 // R1 | RB | R | R1 | 6 | P3 | -#define GPIO_PIN_07 GpioAction::BUTTON_PRESS_A2 // A2 | ~ | Capture | ~ | 14 | ~ | -#define GPIO_PIN_08 GpioAction::BUTTON_PRESS_A1 // A1 | Guide | Home | PS | 13 | ~ | -#define GPIO_PIN_09 GpioAction::BUTTON_PRESS_S1 // S1 | Back | Minus | Select | 9 | Coin | -#define GPIO_PIN_10 GpioAction::BUTTON_PRESS_S2 // S2 | Start | Plus | Start | 10 | Start | -#define GPIO_PIN_11 GpioAction::BUTTON_PRESS_L1 // L1 | LB | L | L1 | 5 | P4 | -#define GPIO_PIN_14 GpioAction::BUTTON_PRESS_RIGHT // RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | -#define GPIO_PIN_15 GpioAction::BUTTON_PRESS_DOWN // DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | -#define GPIO_PIN_26 GpioAction::BUTTON_PRESS_UP // UP | UP | UP | UP | UP | UP | -#define GPIO_PIN_27 GpioAction::BUTTON_PRESS_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | -#define GPIO_PIN_28 GpioAction::BUTTON_PRESS_L2 // L2 | LT | ZL | L2 | 7 | K4 | +## Main Pin Mapping Configuration -GPIO29 is connected to the extra button beside the RP2040 unit. It can be assigned to the function layer if desired. +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_03| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_04| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_05| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_07| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | +| GPIO_PIN_08| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_14| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_15| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_28| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | -At this time there is a small issue with the display layout and you will need to change to `board config` left and right via web-config to see the display that is shown in the image above. \ No newline at end of file +GPIO29 is connected to the extra button beside the RP2040 unit. It can be assigned to the function layer if desired. + +At this time, there is a small issue with the display layout, and you will need to change the `board config` left and right via web-config to see the display that is shown in the image above. diff --git a/configs/ergoSHIFTRev2/README.md b/configs/ergoSHIFTRev2/README.md index b11115428..c4eb87b66 100644 --- a/configs/ergoSHIFTRev2/README.md +++ b/configs/ergoSHIFTRev2/README.md @@ -7,4 +7,27 @@ arcade controller designed by [mizma](https://github.com/mizma/). ## Button mapping -![ergoSHIFT Rev.2 button mapping](./assets/ergoSHIFT-rev2-button-mapping.jpg) \ No newline at end of file +![ergoSHIFT Rev.2 button mapping](./assets/ergoSHIFT-rev2-button-mapping.jpg) + +## Main Pin Mapping Configuration + +| RP2040 Pin | Action | GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade | +|------------|-------------------------------|--------|--------|--------|----------|--------|--------| +| GPIO_PIN_12| GpioAction::BUTTON_PRESS_UP | UP | UP | UP | UP | UP | UP | +| GPIO_PIN_09| GpioAction::BUTTON_PRESS_DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | DOWN | +| GPIO_PIN_11| GpioAction::BUTTON_PRESS_RIGHT| RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | +| GPIO_PIN_06| GpioAction::BUTTON_PRESS_LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +| GPIO_PIN_18| GpioAction::BUTTON_PRESS_B1 | B1 | A | B | Cross | 2 | K1 | +| GPIO_PIN_19| GpioAction::BUTTON_PRESS_B2 | B2 | B | A | Circle | 3 | K2 | +| GPIO_PIN_23| GpioAction::BUTTON_PRESS_R2 | R2 | RT | ZR | R2 | 8 | K3 | +| GPIO_PIN_16| GpioAction::BUTTON_PRESS_L2 | L2 | LT | ZL | L2 | 7 | K4 | +| GPIO_PIN_20| GpioAction::BUTTON_PRESS_B3 | B3 | X | Y | Square | 1 | P1 | +| GPIO_PIN_25| GpioAction::BUTTON_PRESS_B4 | B4 | Y | X | Triangle | 4 | P2 | +| GPIO_PIN_26| GpioAction::BUTTON_PRESS_R1 | R1 | RB | R | R1 | 6 | P3 | +| GPIO_PIN_24| GpioAction::BUTTON_PRESS_L1 | L1 | LB | L | L1 | 5 | P4 | +| GPIO_PIN_27| GpioAction::BUTTON_PRESS_S1 | S1 | Back | Minus | Select | 9 | Coin | +| GPIO_PIN_00| GpioAction::BUTTON_PRESS_S2 | S2 | Start | Plus | Start | 10 | Start | +| GPIO_PIN_10| GpioAction::BUTTON_PRESS_L3 | L3 | LS | LS | L3 | 11 | LS | +| GPIO_PIN_17| GpioAction::BUTTON_PRESS_R3 | R3 | RS | RS | R3 | 12 | RS | +| GPIO_PIN_02| GpioAction::BUTTON_PRESS_A1 | A1 | Guide | Home | PS | 13 | ~ | +| GPIO_PIN_01| GpioAction::BUTTON_PRESS_A2 | A2 | ~ | Capture| ~ | 14 | ~ | \ No newline at end of file diff --git a/configs/ergoSHIFTRev2/assets/ergoSHIFT-rev2-bare1.jpg b/configs/ergoSHIFTRev2/assets/ergoSHIFT-rev2-bare1.jpg index 91498c89d..d4da41c53 100644 Binary files a/configs/ergoSHIFTRev2/assets/ergoSHIFT-rev2-bare1.jpg and b/configs/ergoSHIFTRev2/assets/ergoSHIFT-rev2-bare1.jpg differ diff --git a/configs/ergoSHIFTRev2/assets/ergoSHIFT-rev2-button-mapping.jpg b/configs/ergoSHIFTRev2/assets/ergoSHIFT-rev2-button-mapping.jpg index 3a8ca1738..c88b727d5 100644 Binary files a/configs/ergoSHIFTRev2/assets/ergoSHIFT-rev2-button-mapping.jpg and b/configs/ergoSHIFTRev2/assets/ergoSHIFT-rev2-button-mapping.jpg differ diff --git a/headers/addons/reactiveleds.h b/headers/addons/reactiveleds.h new file mode 100644 index 000000000..47532cdbe --- /dev/null +++ b/headers/addons/reactiveleds.h @@ -0,0 +1,56 @@ +#ifndef REACTIVELEDS_H_ +#define REACTIVELEDS_H_ + +#include "gpaddon.h" + +#ifndef REACTIVE_LED_ENABLED +#define REACTIVE_LED_ENABLED 0 +#endif + +#ifndef REACTIVE_LED_COUNT +#define REACTIVE_LED_COUNT 10 +#endif + +#ifndef REACTIVE_LED_DELAY +#define REACTIVE_LED_DELAY 1 +#endif + +#ifndef REACTIVE_LED_MAX_BRIGHTNESS +#define REACTIVE_LED_MAX_BRIGHTNESS 255 +#endif + +#ifndef REACTIVE_LED_FADE_INC +#define REACTIVE_LED_FADE_INC 1 +#endif + +// Reactive LED Module +#define ReactiveLEDName "ReactiveLED" + +// Reactive LED +class ReactiveLEDAddon : public GPAddon +{ + public: + virtual bool available(); + virtual void setup(); + virtual void preprocess() {} + virtual void process(); + virtual std::string name() { return ReactiveLEDName; } + private: + struct ReactiveLEDPinState { + uint16_t pinNumber = -1; + ReactiveLEDMode modeDown = ReactiveLEDMode::REACTIVE_LED_STATIC_ON; + ReactiveLEDMode modeUp = ReactiveLEDMode::REACTIVE_LED_STATIC_OFF; + GpioAction action = GpioAction::NONE; + uint8_t value = 0; + bool currState = false; + bool prevState = false; + uint32_t lastUpdate; + uint32_t currUpdate; + }; + + ReactiveLEDPinState ledPins[REACTIVE_LED_COUNT]; + + void setLEDByMode(ReactiveLEDPinState &ledState, bool pressed); +}; + +#endif \ No newline at end of file diff --git a/headers/display/GPGFX_UI_screens.h b/headers/display/GPGFX_UI_screens.h index 59bf16d9a..644367853 100644 --- a/headers/display/GPGFX_UI_screens.h +++ b/headers/display/GPGFX_UI_screens.h @@ -5,12 +5,16 @@ enum DisplayMode { CONFIG_INSTRUCTION, BUTTONS, SPLASH, + PIN_VIEWER, + STATS, MAIN_MENU }; #include "ui/screens/ButtonLayoutScreen.h" #include "ui/screens/ConfigScreen.h" #include "ui/screens/MainMenuScreen.h" +#include "ui/screens/PinViewerScreen.h" #include "ui/screens/SplashScreen.h" +#include "ui/screens/StatsScreen.h" #endif \ No newline at end of file diff --git a/headers/display/GPGFX_core.h b/headers/display/GPGFX_core.h index d0d3a28f8..fc37ef36b 100644 --- a/headers/display/GPGFX_core.h +++ b/headers/display/GPGFX_core.h @@ -8,4 +8,31 @@ #include "fonts/GP_Font_Big.h" #include "fonts/GP_Font_Standard.h" +// special characters +#define CHAR_TRIANGLE "\x80" +#define CHAR_CIRCLE "\x81" +#define CHAR_CROSS "\x82" +#define CHAR_SQUARE "\x83" + +#define CHAR_UP "\x84" +#define CHAR_DOWN "\x85" +#define CHAR_LEFT "\x86" +#define CHAR_RIGHT "\x87" + +#define CHAR_UL "\x88" +#define CHAR_UR "\x89" +#define CHAR_DL "\x8A" +#define CHAR_DR "\x8B" + +#define CHAR_CAP_S "\x8C" +#define CHAR_HOME_S "\x8D" + +#define CHAR_VIEW_X "\x8E" +#define CHAR_MENU_X "\x8F" +#define CHAR_HOME_X "\x90" + +#define CHAR_TPAD_P "\x91" +#define CHAR_HOME_P "\x92" +#define CHAR_SHARE_P "\x93" + #endif \ No newline at end of file diff --git a/headers/display/ui/screens/ButtonLayoutScreen.h b/headers/display/ui/screens/ButtonLayoutScreen.h index 1f15d88c5..ce1a42fc6 100644 --- a/headers/display/ui/screens/ButtonLayoutScreen.h +++ b/headers/display/ui/screens/ButtonLayoutScreen.h @@ -11,32 +11,6 @@ #include "GPGFX_UI_widgets.h" #include "GPGFX_UI_layouts.h" -#define CHAR_TRIANGLE "\x80" -#define CHAR_CIRCLE "\x81" -#define CHAR_CROSS "\x82" -#define CHAR_SQUARE "\x83" - -#define CHAR_UP "\x84" -#define CHAR_DOWN "\x85" -#define CHAR_LEFT "\x86" -#define CHAR_RIGHT "\x87" - -#define CHAR_UL "\x88" -#define CHAR_UR "\x89" -#define CHAR_DL "\x8A" -#define CHAR_DR "\x8B" - -#define CHAR_CAP_S "\x8C" -#define CHAR_HOME_S "\x8D" - -#define CHAR_VIEW_X "\x8E" -#define CHAR_MENU_X "\x8F" -#define CHAR_HOME_X "\x90" - -#define CHAR_TPAD_P "\x91" -#define CHAR_HOME_P "\x92" -#define CHAR_SHARE_P "\x93" - #define INPUT_HISTORY_MAX_INPUTS 22 #define INPUT_HISTORY_MAX_MODES 11 diff --git a/headers/display/ui/screens/PinViewerScreen.h b/headers/display/ui/screens/PinViewerScreen.h new file mode 100644 index 000000000..39eec71d8 --- /dev/null +++ b/headers/display/ui/screens/PinViewerScreen.h @@ -0,0 +1,75 @@ +#ifndef _PINVIEWERSCREEN_H_ +#define _PINVIEWERSCREEN_H_ + +#include +#include "GPGFX_UI_widgets.h" + +class PinViewerScreen : public GPScreen { + public: + PinViewerScreen() {} + PinViewerScreen(GPGFX* renderer) { setRenderer(renderer); } + virtual int8_t update(); + virtual void init(); + virtual void shutdown(); + protected: + virtual void drawScreen(); + uint16_t prevButtonState = 0; + + std::map buttonLookup = { + {GpioAction::BUTTON_PRESS_UP, CHAR_UP}, + {GpioAction::BUTTON_PRESS_DOWN, CHAR_DOWN}, + {GpioAction::BUTTON_PRESS_LEFT, CHAR_LEFT}, + {GpioAction::BUTTON_PRESS_RIGHT, CHAR_RIGHT}, + {GpioAction::BUTTON_PRESS_B1, "B1"}, + {GpioAction::BUTTON_PRESS_B2, "B2"}, + {GpioAction::BUTTON_PRESS_B3, "B3"}, + {GpioAction::BUTTON_PRESS_B4, "B4"}, + {GpioAction::BUTTON_PRESS_L1, "L1"}, + {GpioAction::BUTTON_PRESS_R1, "R1"}, + {GpioAction::BUTTON_PRESS_L2, "L2"}, + {GpioAction::BUTTON_PRESS_R2, "R2"}, + {GpioAction::BUTTON_PRESS_S1, "S1"}, + {GpioAction::BUTTON_PRESS_S2, "S2"}, + {GpioAction::BUTTON_PRESS_A1, "A1"}, + {GpioAction::BUTTON_PRESS_A2, "A2"}, + {GpioAction::BUTTON_PRESS_L3, "L3"}, + {GpioAction::BUTTON_PRESS_R3, "R3"}, + {GpioAction::BUTTON_PRESS_FN, "FN"}, + {GpioAction::BUTTON_PRESS_DDI_UP, "DDI" CHAR_UP}, + {GpioAction::BUTTON_PRESS_DDI_DOWN, "DDI" CHAR_DOWN}, + {GpioAction::BUTTON_PRESS_DDI_LEFT, "DDI" CHAR_LEFT}, + {GpioAction::BUTTON_PRESS_DDI_RIGHT, "DDI" CHAR_RIGHT}, + {GpioAction::SUSTAIN_DP_MODE_DP, "DP"}, + {GpioAction::SUSTAIN_DP_MODE_LS, "LS"}, + {GpioAction::SUSTAIN_DP_MODE_RS, "RS"}, + {GpioAction::SUSTAIN_SOCD_MODE_UP_PRIO, "SOCD-UP"}, + {GpioAction::SUSTAIN_SOCD_MODE_NEUTRAL, "SOCD-N"}, + {GpioAction::SUSTAIN_SOCD_MODE_SECOND_WIN, "SOCD-2W"}, + {GpioAction::SUSTAIN_SOCD_MODE_FIRST_WIN, "SOCD-1W"}, + {GpioAction::SUSTAIN_SOCD_MODE_BYPASS, "SOCD-BP"}, + {GpioAction::BUTTON_PRESS_TURBO, "TRB"}, + {GpioAction::BUTTON_PRESS_MACRO, "M"}, + {GpioAction::BUTTON_PRESS_MACRO_1, "M1"}, + {GpioAction::BUTTON_PRESS_MACRO_2, "M2"}, + {GpioAction::BUTTON_PRESS_MACRO_3, "M3"}, + {GpioAction::BUTTON_PRESS_MACRO_4, "M4"}, + {GpioAction::BUTTON_PRESS_MACRO_5, "M5"}, + {GpioAction::BUTTON_PRESS_MACRO_6, "M6"}, + {GpioAction::BUTTON_PRESS_A3, "A3"}, + {GpioAction::BUTTON_PRESS_A4, "A4"}, + {GpioAction::BUTTON_PRESS_E1, "E1"}, + {GpioAction::BUTTON_PRESS_E2, "E2"}, + {GpioAction::BUTTON_PRESS_E3, "E3"}, + {GpioAction::BUTTON_PRESS_E4, "E4"}, + {GpioAction::BUTTON_PRESS_E5, "E5"}, + {GpioAction::BUTTON_PRESS_E6, "E6"}, + {GpioAction::BUTTON_PRESS_E7, "E7"}, + {GpioAction::BUTTON_PRESS_E8, "E8"}, + {GpioAction::BUTTON_PRESS_E9, "E9"}, + {GpioAction::BUTTON_PRESS_E10, "E10"}, + {GpioAction::BUTTON_PRESS_E11, "E11"}, + {GpioAction::BUTTON_PRESS_E12, "E12"}, + }; +}; + +#endif \ No newline at end of file diff --git a/headers/display/ui/screens/StatsScreen.h b/headers/display/ui/screens/StatsScreen.h new file mode 100644 index 000000000..f8411c884 --- /dev/null +++ b/headers/display/ui/screens/StatsScreen.h @@ -0,0 +1,18 @@ +#ifndef _STATSSCREEN_H_ +#define _STATSSCREEN_H_ + +#include "GPGFX_UI_widgets.h" + +class StatsScreen : public GPScreen { + public: + StatsScreen() {} + StatsScreen(GPGFX* renderer) { setRenderer(renderer); } + virtual int8_t update(); + virtual void init(); + virtual void shutdown(); + protected: + virtual void drawScreen(); + uint16_t prevButtonState = 0; +}; + +#endif \ No newline at end of file diff --git a/headers/version.h.in b/headers/version.h.in index bb6b621e6..bf916c4ef 100644 --- a/headers/version.h.in +++ b/headers/version.h.in @@ -1 +1,5 @@ #define GP2040VERSION "${GIT_REPO_VERSION}" +#define GP2040VERSIONID "${CMAKE_GIT_REPO_VERSION}" +#define GP2040BUILD "${GIT_REPO_BUILD_ID}" +#define GP2040CONFIG "${CMAKE_BUILD_TYPE}" +#define GP2040PLATFORM "${PICO_PLATFORM}" diff --git a/lib/PicoPeripherals/peripheral_i2c.cpp b/lib/PicoPeripherals/peripheral_i2c.cpp index e0eb7d9e3..33c6203ad 100644 --- a/lib/PicoPeripherals/peripheral_i2c.cpp +++ b/lib/PicoPeripherals/peripheral_i2c.cpp @@ -3,7 +3,13 @@ PeripheralI2C::PeripheralI2C() { #ifdef PICO_DEFAULT_I2C_INSTANCE + +#if PICO_SDK_VERSION_MAJOR >= 2 + _I2C = PICO_DEFAULT_I2C_INSTANCE(); +#else _I2C = PICO_DEFAULT_I2C_INSTANCE; +#endif + _SDA = PICO_DEFAULT_I2C_SDA_PIN; _SCL = PICO_DEFAULT_I2C_SCL_PIN; _Speed = DEFAULT_SPEED; diff --git a/lib/PicoPeripherals/peripheral_spi.cpp b/lib/PicoPeripherals/peripheral_spi.cpp index bbb3ec55b..434dbf223 100644 --- a/lib/PicoPeripherals/peripheral_spi.cpp +++ b/lib/PicoPeripherals/peripheral_spi.cpp @@ -3,7 +3,13 @@ PeripheralSPI::PeripheralSPI() { #ifdef PICO_DEFAULT_SPI_INSTANCE + +#if PICO_SDK_VERSION_MAJOR >= 2 + _SPI = PICO_DEFAULT_SPI_INSTANCE(); +#elif defined(PICO_DEFAULT_SPI_INSTANCE) _SPI = PICO_DEFAULT_SPI_INSTANCE; +#endif + _TX = PICO_DEFAULT_SPI_TX_PIN; _RX = PICO_DEFAULT_SPI_RX_PIN; _SCK = PICO_DEFAULT_SPI_SCK_PIN; diff --git a/proto/config.proto b/proto/config.proto index a6baf647a..d276889da 100644 --- a/proto/config.proto +++ b/proto/config.proto @@ -755,6 +755,20 @@ message DRV8833RumbleOptions optional float dutyMax = 7; } +message ReactiveLEDInfo +{ + optional int32 pin = 1; + optional GpioAction action = 2; + optional ReactiveLEDMode modeDown = 3; + optional ReactiveLEDMode modeUp = 4; +} + +message ReactiveLEDOptions +{ + optional bool enabled = 1; + repeated ReactiveLEDInfo leds = 2 [(nanopb).max_count = 10]; +} + message AddonOptions { optional BootselButtonOptions bootselButtonOptions = 1; @@ -783,6 +797,7 @@ message AddonOptions optional RotaryOptions rotaryOptions = 24; optional PCF8575Options pcf8575Options = 25; optional DRV8833RumbleOptions drv8833RumbleOptions = 26; + optional ReactiveLEDOptions reactiveLEDOptions = 27; } message MigrationHistory diff --git a/proto/enums.proto b/proto/enums.proto index 52a624f05..d1eeb06bb 100644 --- a/proto/enums.proto +++ b/proto/enums.proto @@ -111,7 +111,7 @@ enum SplashChoice enum OnBoardLedMode { option (nanopb_enumopt).long_names = false; - + ON_BOARD_LED_MODE_OFF = 0; ON_BOARD_LED_MODE_MODE_INDICATOR = 1; ON_BOARD_LED_MODE_INPUT_TEST = 2; @@ -295,6 +295,10 @@ enum GamepadHotkey HOTKEY_NEXT_PROFILE = 35; HOTKEY_A3_BUTTON = 36; HOTKEY_A4_BUTTON = 37; + HOTKEY_DPAD_UP = 38; + HOTKEY_DPAD_DOWN = 39; + HOTKEY_DPAD_LEFT = 40; + HOTKEY_DPAD_RIGHT = 41; } // This has to be kept in sync with LEDFormat in NeoPico.hpp @@ -317,7 +321,7 @@ enum ShmupMixMode enum PLEDType { option (nanopb_enumopt).long_names = false; - + PLED_TYPE_NONE = -1; PLED_TYPE_PWM = 0; PLED_TYPE_RGB = 1; @@ -326,7 +330,7 @@ enum PLEDType enum ForcedSetupMode { option (nanopb_enumopt).long_names = false; - + FORCED_SETUP_MODE_OFF = 0; FORCED_SETUP_MODE_LOCK_MODE_SWITCH = 1; FORCED_SETUP_MODE_LOCK_WEB_CONFIG = 2; @@ -346,7 +350,7 @@ enum DualDirectionalCombinationMode enum PS4ControllerType { option (nanopb_enumopt).long_names = false; - + PS4_CONTROLLER = 0; PS4_ARCADESTICK = 7; } @@ -378,7 +382,7 @@ enum GPElement enum GPShape_Type { option (nanopb_enumopt).long_names = false; - + GP_SHAPE_ELLIPSE = 0; GP_SHAPE_SQUARE = 1; GP_SHAPE_LINE = 2; @@ -400,3 +404,13 @@ enum RotaryEncoderPinMode ENCODER_MODE_DPAD_X = 7; ENCODER_MODE_DPAD_Y = 8; }; + +enum ReactiveLEDMode +{ + option (nanopb_enumopt).long_names = false; + + REACTIVE_LED_STATIC_OFF = 0; + REACTIVE_LED_STATIC_ON = 1; + REACTIVE_LED_FADE_IN = 2; + REACTIVE_LED_FADE_OUT = 3; +}; diff --git a/src/addons/display.cpp b/src/addons/display.cpp index de5e45746..3d7b02b10 100644 --- a/src/addons/display.cpp +++ b/src/addons/display.cpp @@ -84,6 +84,12 @@ bool DisplayAddon::updateDisplayScreen() { case BUTTONS: delete (ButtonLayoutScreen*)gpScreen; break; + case PIN_VIEWER: + delete (PinViewerScreen*)gpScreen; + break; + case STATS: + delete (StatsScreen*)gpScreen; + break; default: break; } @@ -102,6 +108,12 @@ bool DisplayAddon::updateDisplayScreen() { case BUTTONS: gpScreen = new ButtonLayoutScreen(gpDisplay); break; + case PIN_VIEWER: + gpScreen = new PinViewerScreen(gpDisplay); + break; + case STATS: + gpScreen = new StatsScreen(gpDisplay); + break; default: gpScreen = nullptr; break; diff --git a/src/addons/reactiveleds.cpp b/src/addons/reactiveleds.cpp new file mode 100644 index 000000000..1a9255340 --- /dev/null +++ b/src/addons/reactiveleds.cpp @@ -0,0 +1,114 @@ +#include "hardware/pwm.h" +#include "addons/reactiveleds.h" +#include "storagemanager.h" +#include "usbdriver.h" +#include "helper.h" +#include "config.pb.h" + +bool ReactiveLEDAddon::available() { + bool pinsEnabled = false; + const ReactiveLEDOptions& options = Storage::getInstance().getAddonOptions().reactiveLEDOptions; + for (uint8_t led = 0; led < REACTIVE_LED_COUNT; led++) { + if (isValidPin(options.leds[led].pin)) { + pinsEnabled = true; + break; + } + } + return options.enabled && pinsEnabled; +} + +void ReactiveLEDAddon::setup() { + const ReactiveLEDOptions& options = Storage::getInstance().getAddonOptions().reactiveLEDOptions; + + for (uint8_t led = 0; led < REACTIVE_LED_COUNT; led++) { + ReactiveLEDInfo ledInfo = options.leds[led]; + + ledPins[led].pinNumber = ledInfo.pin; + ledPins[led].action = ledInfo.action; + ledPins[led].modeDown = ledInfo.modeDown; + ledPins[led].modeUp = ledInfo.modeUp; + + if (isValidPin(ledPins[led].pinNumber)) { + gpio_init(ledPins[led].pinNumber); + gpio_set_dir(ledPins[led].pinNumber, GPIO_OUT); + gpio_set_function(ledPins[led].pinNumber, GPIO_FUNC_PWM); + + pwm_set_wrap(pwm_gpio_to_slice_num(ledPins[led].pinNumber), REACTIVE_LED_MAX_BRIGHTNESS); + pwm_set_enabled(pwm_gpio_to_slice_num(ledPins[led].pinNumber), true); + + ledPins[led].lastUpdate = to_ms_since_boot(get_absolute_time()); + + setLEDByMode(ledPins[led], false); + } + } +} + +void ReactiveLEDAddon::process() { + Gamepad * gamepad = Storage::getInstance().GetProcessedGamepad(); + + uint32_t currUpdate = to_ms_since_boot(get_absolute_time()); + + for (uint8_t led = 0; led < REACTIVE_LED_COUNT; led++) { + if (isValidPin(ledPins[led].pinNumber) && ledPins[led].action != GpioAction::NONE) { + ledPins[led].currUpdate = currUpdate; + switch (ledPins[led].action) { + case BUTTON_PRESS_UP: setLEDByMode(ledPins[led], gamepad->pressedDpad(GAMEPAD_MASK_UP)); break; + case BUTTON_PRESS_DOWN: setLEDByMode(ledPins[led], gamepad->pressedDpad(GAMEPAD_MASK_DOWN)); break; + case BUTTON_PRESS_LEFT: setLEDByMode(ledPins[led], gamepad->pressedDpad(GAMEPAD_MASK_LEFT)); break; + case BUTTON_PRESS_RIGHT: setLEDByMode(ledPins[led], gamepad->pressedDpad(GAMEPAD_MASK_RIGHT)); break; + case BUTTON_PRESS_B1: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_B1)); break; + case BUTTON_PRESS_B2: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_B2)); break; + case BUTTON_PRESS_B3: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_B3)); break; + case BUTTON_PRESS_B4: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_B4)); break; + case BUTTON_PRESS_L1: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_L1)); break; + case BUTTON_PRESS_R1: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_R1)); break; + case BUTTON_PRESS_L2: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_L2)); break; + case BUTTON_PRESS_R2: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_R2)); break; + case BUTTON_PRESS_S1: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_S1)); break; + case BUTTON_PRESS_S2: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_S2)); break; + case BUTTON_PRESS_A1: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_A1)); break; + case BUTTON_PRESS_A2: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_A2)); break; + case BUTTON_PRESS_L3: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_L3)); break; + case BUTTON_PRESS_R3: setLEDByMode(ledPins[led], gamepad->pressedButton(GAMEPAD_MASK_R3)); break; + default: break; + } + } + } +} + +void ReactiveLEDAddon::setLEDByMode(ReactiveLEDPinState &ledState, bool pressed) { + ledState.currState = pressed; + + switch (pressed ? ledState.modeDown : ledState.modeUp) { + case ReactiveLEDMode::REACTIVE_LED_STATIC_OFF: + ledState.value = 0; + break; + case ReactiveLEDMode::REACTIVE_LED_STATIC_ON: + ledState.value = 255; + break; + case ReactiveLEDMode::REACTIVE_LED_FADE_IN: + if (ledState.currUpdate - ledState.lastUpdate >= REACTIVE_LED_DELAY) { + if (ledState.prevState != pressed) ledState.value = 0; + if (ledState.value < REACTIVE_LED_MAX_BRIGHTNESS) { + ledState.value+=REACTIVE_LED_FADE_INC; + } + + ledState.lastUpdate = ledState.currUpdate; + } + break; + case ReactiveLEDMode::REACTIVE_LED_FADE_OUT: + if (ledState.currUpdate - ledState.lastUpdate >= REACTIVE_LED_DELAY) { + if (ledState.prevState != pressed) ledState.value = REACTIVE_LED_MAX_BRIGHTNESS; + if (ledState.value > 0) { + ledState.value-=REACTIVE_LED_FADE_INC; + } + + ledState.lastUpdate = ledState.currUpdate; + } + break; + } + + pwm_set_gpio_level(ledState.pinNumber, ledState.value); + + ledState.prevState = pressed; +} diff --git a/src/config_utils.cpp b/src/config_utils.cpp index e553687b8..21844b3ed 100644 --- a/src/config_utils.cpp +++ b/src/config_utils.cpp @@ -24,6 +24,7 @@ #include "addons/neopicoleds.h" #include "addons/playernum.h" #include "addons/pleds.h" +#include "addons/reactiveleds.h" #include "addons/reverse.h" #include "addons/slider_socd.h" #include "addons/spi_analog_ads1256.h" @@ -724,6 +725,17 @@ void ConfigUtils::initUnsetPropertiesWithDefaults(Config& config) INIT_UNSET_PROPERTY(config.addonOptions.rotaryOptions.encoderTwo, allowWrapAround, ENCODER_TWO_WRAP); INIT_UNSET_PROPERTY(config.addonOptions.rotaryOptions.encoderTwo, multiplier, ENCODER_TWO_MULTIPLIER); + // addonOptions.reactiveLEDOptions + INIT_UNSET_PROPERTY(config.addonOptions.reactiveLEDOptions, enabled, !!REACTIVE_LED_ENABLED); + for (uint16_t led = 0; led < REACTIVE_LED_COUNT; led++) { + INIT_UNSET_PROPERTY(config.addonOptions.reactiveLEDOptions.leds[led], pin, -1); + INIT_UNSET_PROPERTY(config.addonOptions.reactiveLEDOptions.leds[led], action, GpioAction::NONE); + INIT_UNSET_PROPERTY(config.addonOptions.reactiveLEDOptions.leds[led], modeDown, REACTIVE_LED_STATIC_ON); + INIT_UNSET_PROPERTY(config.addonOptions.reactiveLEDOptions.leds[led], modeUp, REACTIVE_LED_STATIC_OFF); + } + // reminder that this must be set or else nanopb won't retain anything + config.addonOptions.reactiveLEDOptions.leds_count = REACTIVE_LED_COUNT; + // keyboardMapping INIT_UNSET_PROPERTY(config.addonOptions.keyboardHostOptions, enabled, KEYBOARD_HOST_ENABLED); INIT_UNSET_PROPERTY(config.addonOptions.keyboardHostOptions, deprecatedPinDplus, KEYBOARD_HOST_PIN_DPLUS); diff --git a/src/configs/webconfig.cpp b/src/configs/webconfig.cpp index 4303e27d5..79991d161 100644 --- a/src/configs/webconfig.cpp +++ b/src/configs/webconfig.cpp @@ -1347,6 +1347,40 @@ std::string setExpansionPins() return serialize_json(doc); } +std::string getReactiveLEDs() +{ + DynamicJsonDocument doc(LWIP_HTTPD_POST_MAX_PAYLOAD_LEN); + ReactiveLEDInfo* ledInfo = Storage::getInstance().getAddonOptions().reactiveLEDOptions.leds; + + for (uint16_t led = 0; led < 10; led++) { + writeDoc(doc, "leds", led, "pin", ledInfo[led].pin); + writeDoc(doc, "leds", led, "action", ledInfo[led].action); + writeDoc(doc, "leds", led, "modeDown", ledInfo[led].modeDown); + writeDoc(doc, "leds", led, "modeUp", ledInfo[led].modeUp); + } + + return serialize_json(doc); +} + +std::string setReactiveLEDs() +{ + DynamicJsonDocument doc = get_post_data(); + + ReactiveLEDInfo* ledInfo = Storage::getInstance().getAddonOptions().reactiveLEDOptions.leds; + + for (uint16_t led = 0; led < 10; led++) { + ledInfo[led].pin = doc["leds"][led]["pin"]; + ledInfo[led].action = doc["leds"][led]["action"]; + ledInfo[led].modeDown = doc["leds"][led]["modeDown"]; + ledInfo[led].modeUp = doc["leds"][led]["modeUp"]; + } + Storage::getInstance().getAddonOptions().reactiveLEDOptions.leds_count = 10; + + Storage::getInstance().save(); + + return serialize_json(doc); +} + std::string setAddonOptions() { DynamicJsonDocument doc = get_post_data(); @@ -1524,6 +1558,9 @@ std::string setAddonOptions() PCF8575Options& pcf8575Options = Storage::getInstance().getAddonOptions().pcf8575Options; docToValue(pcf8575Options.enabled, doc, "PCF8575AddonEnabled"); + ReactiveLEDOptions& reactiveLEDOptions = Storage::getInstance().getAddonOptions().reactiveLEDOptions; + docToValue(reactiveLEDOptions.enabled, doc, "ReactiveLEDAddonEnabled"); + DRV8833RumbleOptions& drv8833RumbleOptions = Storage::getInstance().getAddonOptions().drv8833RumbleOptions; docToValue(drv8833RumbleOptions.enabled, doc, "DRV8833RumbleAddonEnabled"); docToPin(drv8833RumbleOptions.leftMotorPin, doc, "drv8833RumbleLeftMotorPin"); @@ -1958,6 +1995,9 @@ std::string getAddonOptions() PCF8575Options& pcf8575Options = Storage::getInstance().getAddonOptions().pcf8575Options; writeDoc(doc, "PCF8575AddonEnabled", pcf8575Options.enabled); + ReactiveLEDOptions& reactiveLEDOptions = Storage::getInstance().getAddonOptions().reactiveLEDOptions; + writeDoc(doc, "ReactiveLEDAddonEnabled", reactiveLEDOptions.enabled); + const DRV8833RumbleOptions& drv8833RumbleOptions = Storage::getInstance().getAddonOptions().drv8833RumbleOptions; writeDoc(doc, "DRV8833RumbleAddonEnabled", drv8833RumbleOptions.enabled); writeDoc(doc, "drv8833RumbleLeftMotorPin", cleanPin(drv8833RumbleOptions.leftMotorPin)); @@ -2227,6 +2267,8 @@ static const std::pair handlerFuncs[] = { "/api/getI2CPeripheralMap", getI2CPeripheralMap }, { "/api/setExpansionPins", setExpansionPins }, { "/api/getExpansionPins", getExpansionPins }, + { "/api/setReactiveLEDs", setReactiveLEDs }, + { "/api/getReactiveLEDs", getReactiveLEDs }, { "/api/setKeyMappings", setKeyMappings }, { "/api/setAddonsOptions", setAddonOptions }, { "/api/setMacroAddonOptions", setMacroAddonOptions }, diff --git a/src/display/ui/screens/ConfigScreen.cpp b/src/display/ui/screens/ConfigScreen.cpp index eb5c264ac..60663c47d 100644 --- a/src/display/ui/screens/ConfigScreen.cpp +++ b/src/display/ui/screens/ConfigScreen.cpp @@ -16,15 +16,18 @@ int8_t ConfigScreen::update() { if (prevButtonState && !buttonState) { switch (prevButtonState) { case (GAMEPAD_MASK_B1): - //prevDisplayMode = prevDisplayMode == DisplayMode::BUTTONS ? DisplayMode::CONFIG_INSTRUCTION : DisplayMode::BUTTONS; prevButtonState = 0; return DisplayMode::BUTTONS; case (GAMEPAD_MASK_B2): - //prevDisplayMode = prevDisplayMode == DisplayMode::SPLASH ? DisplayMode::CONFIG_INSTRUCTION : DisplayMode::SPLASH; prevButtonState = 0; return DisplayMode::SPLASH; + case (GAMEPAD_MASK_B3): + prevButtonState = 0; + return DisplayMode::PIN_VIEWER; + case (GAMEPAD_MASK_B4): + prevButtonState = 0; + return DisplayMode::STATS; default: - //prevDisplayMode = DisplayMode::CONFIG_INSTRUCTION; break; } } @@ -33,10 +36,12 @@ int8_t ConfigScreen::update() { } void ConfigScreen::drawScreen() { - getRenderer()->drawText(0, 0, "[Web Config Mode]"); + getRenderer()->drawText(2, 0, "[Web Config Mode]"); getRenderer()->drawText(0, 1, version); getRenderer()->drawText(0, 2, "[http://192.168.7.1]"); getRenderer()->drawText(0, 3, "Preview:"); - getRenderer()->drawText(5, 4, " B1 > Button"); - getRenderer()->drawText(5, 5, " B2 > Splash"); + getRenderer()->drawText(3, 4, " B1 > Button"); + getRenderer()->drawText(3, 5, " B2 > Splash"); + getRenderer()->drawText(3, 6, " B3 > Pin Viewer"); + getRenderer()->drawText(3, 7, " B4 > Stats"); } \ No newline at end of file diff --git a/src/display/ui/screens/PinViewerScreen.cpp b/src/display/ui/screens/PinViewerScreen.cpp new file mode 100644 index 000000000..b83666bd3 --- /dev/null +++ b/src/display/ui/screens/PinViewerScreen.cpp @@ -0,0 +1,66 @@ +#include "PinViewerScreen.h" + +#include "pico/stdlib.h" + +void PinViewerScreen::init() { + getRenderer()->clearScreen(); +} + +void PinViewerScreen::shutdown() { + clearElements(); +} + +void PinViewerScreen::drawScreen() { + Mask_t pinValues = ~gpio_get_all(); + GpioMappingInfo* pinMappings = Storage::getInstance().getProfilePinMappings(); + + std::string pinsPressed = "PIN: "; + std::string pinsInUse = "In Use: "; + std::string pinsUndefined = "Undef: "; + std::string buttonsPressed = "BTN: "; + + getRenderer()->drawText(5, 0, "[Pin Viewer]"); + + for (Pin_t pin = 0; pin < (Pin_t)NUM_BANK0_GPIOS; pin++) { + if ((pinMappings[pin].action > 0) && (pinMappings[pin].action != GpioAction::CUSTOM_BUTTON_COMBO)) { + if ((pinValues >> pin) & 0x01) { + pinsPressed += std::to_string(pin); + pinsPressed += " "; + + const char * action = buttonLookup[pinMappings[pin].action]; + buttonsPressed += action; + buttonsPressed += " "; + } + } else { + if (pinMappings[pin].action != GpioAction::NONE) { + pinsInUse += std::to_string(pin); + pinsInUse += " "; + } else { + pinsUndefined += std::to_string(pin); + pinsUndefined += " "; + } + } + } + + getRenderer()->drawText(0, 2, pinsUndefined.c_str()); + getRenderer()->drawText(0, 3, pinsInUse.c_str()); + getRenderer()->drawText(0, 4, pinsPressed.c_str()); + getRenderer()->drawText(0, 5, buttonsPressed.c_str()); + + getRenderer()->drawText(4, 7, "A2 to Return"); +} + +int8_t PinViewerScreen::update() { + if (Storage::getInstance().GetConfigMode()) { + uint16_t buttonState = getGamepad()->state.buttons; + if (prevButtonState && !buttonState) { + if (prevButtonState == GAMEPAD_MASK_A2) { + prevButtonState = 0; + return DisplayMode::CONFIG_INSTRUCTION; + } + } + prevButtonState = buttonState; + } + + return -1; // -1 means no change in screen state +} diff --git a/src/display/ui/screens/StatsScreen.cpp b/src/display/ui/screens/StatsScreen.cpp new file mode 100644 index 000000000..eee1f6734 --- /dev/null +++ b/src/display/ui/screens/StatsScreen.cpp @@ -0,0 +1,38 @@ +#include "StatsScreen.h" + +#include "pico/stdlib.h" +#include "version.h" + +void StatsScreen::init() { + getRenderer()->clearScreen(); +} + +void StatsScreen::shutdown() { + clearElements(); +} + +void StatsScreen::drawScreen() { + getRenderer()->drawText(2, 0, "[GP2040-CE Stats]"); + getRenderer()->drawText(0, 1, "Version: " GP2040VERSIONID); + getRenderer()->drawText(0, 2, "Build: " GP2040BUILD); + getRenderer()->drawText(0, 3, "Board: " GP2040_BOARDCONFIG); + getRenderer()->drawText(0, 4, "Type: " GP2040CONFIG); + getRenderer()->drawText(0, 5, "Arch: " GP2040PLATFORM); + + getRenderer()->drawText(5, 7, "B2 to Return"); +} + +int8_t StatsScreen::update() { + if (Storage::getInstance().GetConfigMode()) { + uint16_t buttonState = getGamepad()->state.buttons; + if (prevButtonState && !buttonState) { + if (prevButtonState == GAMEPAD_MASK_B2) { + prevButtonState = 0; + return DisplayMode::CONFIG_INSTRUCTION; + } + } + prevButtonState = buttonState; + } + + return -1; // -1 means no change in screen state +} diff --git a/src/gamepad.cpp b/src/gamepad.cpp index b8f0572b4..f34aaca93 100644 --- a/src/gamepad.cpp +++ b/src/gamepad.cpp @@ -440,6 +440,18 @@ void Gamepad::processHotkeyAction(GamepadHotkey action) { case HOTKEY_A4_BUTTON: state.buttons |= GAMEPAD_MASK_A4; break; + case HOTKEY_DPAD_UP: + state.dpad |= GAMEPAD_MASK_UP; + break; + case HOTKEY_DPAD_DOWN: + state.dpad |= GAMEPAD_MASK_DOWN; + break; + case HOTKEY_DPAD_LEFT: + state.dpad |= GAMEPAD_MASK_LEFT; + break; + case HOTKEY_DPAD_RIGHT: + state.dpad |= GAMEPAD_MASK_RIGHT; + break; case HOTKEY_SOCD_UP_PRIORITY: if (action != lastAction) { options.socdMode = SOCD_MODE_UP_PRIORITY; diff --git a/src/gp2040aux.cpp b/src/gp2040aux.cpp index 531c31604..bd669989b 100644 --- a/src/gp2040aux.cpp +++ b/src/gp2040aux.cpp @@ -11,6 +11,7 @@ #include "addons/display.h" #include "addons/pleds.h" #include "addons/neopicoleds.h" +#include "addons/reactiveleds.h" #include "addons/drv8833_rumble.h" #include @@ -35,6 +36,7 @@ void GP2040Aux::setup() { addons.LoadAddon(new BoardLedAddon(), CORE1_LOOP); addons.LoadAddon(new BuzzerSpeakerAddon(), CORE1_LOOP); addons.LoadAddon(new DRV8833RumbleAddon(), CORE1_LOOP); + addons.LoadAddon(new ReactiveLEDAddon(), CORE1_LOOP); // Initialize our input driver's auxilliary functions inputDriver = DriverManager::getInstance().getDriver(); diff --git a/src/interfaces/i2c/ssd1306/tiny_ssd1306.cpp b/src/interfaces/i2c/ssd1306/tiny_ssd1306.cpp index e16ad5ba7..effa25bbb 100644 --- a/src/interfaces/i2c/ssd1306/tiny_ssd1306.cpp +++ b/src/interfaces/i2c/ssd1306/tiny_ssd1306.cpp @@ -147,7 +147,9 @@ void GPGFX_TinySSD1306::drawText(uint8_t x, uint8_t y, std::string text, uint8_t uint8_t charOffset = 0; const uint8_t* currGlyph; - for (uint8_t charIndex = 0; charIndex < text.size(); charIndex++) { + uint8_t maxTextSize = (MAX_SCREEN_WIDTH / _options.font.width); + + for (uint8_t charIndex = 0; charIndex < MIN(text.size(), maxTextSize); charIndex++) { currChar = text[charIndex]; glyphIndex = currChar - GPGFX_FONT_CHAR_OFFSET; currGlyph = &_options.font.fontData[glyphIndex * ((_options.font.width - 1) * (_options.font.height/8))]; diff --git a/www/server/app.js b/www/server/app.js index 852547088..6f8418bc5 100644 --- a/www/server/app.js +++ b/www/server/app.js @@ -512,6 +512,7 @@ app.get('/api/getAddonsOptions', (req, res) => { RotaryAddonEnabled: 1, PCF8575AddonEnabled: 1, DRV8833RumbleAddonEnabled: 1, + ReactiveLEDAddonEnabled: 1, usedPins: Object.values(picoController), }); }); @@ -734,6 +735,23 @@ app.get('/api/getButtonLayoutDefs', (req, res) => { }); }); +app.get('/api/getReactiveLEDs', (req, res) => { + return res.send({ + leds: [ + { pin: -1, action: -10, modeDown: 0, modeUp: 1 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + { pin: -1, action: -10, modeDown: 1, modeUp: 0 }, + ], + }); +}); + app.get('/api/reboot', (req, res) => { return res.send({}); }); diff --git a/www/src/Addons/ReactiveLED.tsx b/www/src/Addons/ReactiveLED.tsx new file mode 100644 index 000000000..7f2225f22 --- /dev/null +++ b/www/src/Addons/ReactiveLED.tsx @@ -0,0 +1,176 @@ +import { AppContext } from '../Contexts/AppContext'; +import React, { useContext, useEffect, useState } from 'react'; +import { useTranslation } from 'react-i18next'; +import * as yup from 'yup'; + +import invert from 'lodash/invert'; +import omit from 'lodash/omit'; +import zip from 'lodash/zip'; + +import Section from '../Components/Section'; +import FormSelect from '../Components/FormSelect'; +import FormControl from '../Components/FormControl'; +import { Button, FormCheck, Row, Col } from 'react-bootstrap'; + +import WebApi, { } from '../Services/WebApi'; + +import { + BUTTON_ACTIONS, + PinActionValues, +} from '../Data/Pins'; +import { getButtonLabels } from '../Data/Buttons'; + +const NON_SELECTABLE_BUTTON_ACTIONS = [ + -5, 0, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40 +]; + +const REACTIVE_LED_MODES = [ + { label: 'static-off', value: 0 }, + { label: 'static-on', value: 1 }, + { label: 'fade-in', value: 2 }, + { label: 'fade-out', value: 3 }, +]; + +export const reactiveLEDScheme = { + ReactiveLEDAddonEnabled: yup + .number() + .required() + .label('Reactive LED Add-On Enabled'), +}; + +export const reactiveLEDState = { + ReactiveLEDAddonEnabled: 0, +}; + +const isNonSelectable = (value) => + NON_SELECTABLE_BUTTON_ACTIONS.includes(value); + +const getOption = (o, actionId) => { + return { + label: invert(BUTTON_ACTIONS)[actionId], + value: actionId, + }; +}; + +const ReactiveLED = ({ values, errors, handleChange, handleCheckbox }) => { + const { t } = useTranslation(); + const [reactiveLEDs, setSelectedLEDs] = useState([]); + const [selectedLEDs] = useState([]); + const { setLoading, buttonLabels } = useContext(AppContext); + + const { buttonLabelType, swapTpShareLabels } = buttonLabels; + const CURRENT_BUTTONS = getButtonLabels(buttonLabelType, swapTpShareLabels); + const buttonNames = omit(CURRENT_BUTTONS, ['label', 'value']); + + useEffect(() => { + async function fetchData() { + const ledSettings = await WebApi.getReactiveLEDs(setLoading); + setSelectedLEDs(ledSettings.leds); + } + + fetchData(); + }, [setSelectedLEDs, selectedLEDs]); + + const handleLEDChange = (c : any, idx : Number, field : String, value : Number) => { + c[idx][field] = value; + console.dir(c); + return [...c]; + }; + + const saveLEDSettings = async () => { + const ledSettings = await WebApi.setReactiveLEDs({leds: reactiveLEDs}); + }; + + return ( +
+ + { + handleCheckbox('ReactiveLEDAddonEnabled', values); + handleChange(e); + }} + /> +
+ ); +}; + +export default ReactiveLED; diff --git a/www/src/Data/Keyboard.js b/www/src/Data/Keyboard.js index c13d4da02..1cad9c5ac 100644 --- a/www/src/Data/Keyboard.js +++ b/www/src/Data/Keyboard.js @@ -41,7 +41,7 @@ export const KEY_CODES = [ { label: 'Arrow Left', value: 0x50 }, { label: 'Arrow Right', value: 0x4f }, { label: 'Arrow Up', value: 0x52 }, - { label: 'Backquote', value: 0x35 }, + { label: 'Backquote (Grave/Tilde)', value: 0x35 }, { label: 'Backslash', value: 0x31 }, { label: 'Backspace', value: 0x2a }, { label: 'Bracket Left', value: 0x2f }, @@ -88,6 +88,7 @@ export const KEY_CODES = [ { label: 'F22', value: 0x71 }, { label: 'F23', value: 0x72 }, { label: 'F24', value: 0x73 }, + { label: 'Insert', value: 0x49 }, { label: 'Home', value: 0x4a }, { label: 'Intl Backslash', value: 0x31 }, { label: 'A', value: 0x04 }, diff --git a/www/src/Locales/en/Addons/ReactiveLED.jsx b/www/src/Locales/en/Addons/ReactiveLED.jsx new file mode 100644 index 000000000..d49d7f8b3 --- /dev/null +++ b/www/src/Locales/en/Addons/ReactiveLED.jsx @@ -0,0 +1,15 @@ +export default { + 'header-text': 'Reactive LEDs', + 'button-save': 'Save LEDs', + 'led-panel-label': 'LED #{{index}}', + 'led-pin-label': 'LED Pin', + 'led-action-label': 'Action', + 'led-mode-up-label': 'Default Mode', + 'led-mode-down-label': 'Active Mode', + 'led-mode': { + 'static-on': 'Static On', + 'static-off': 'Static Off', + 'fade-in': 'Fade In', + 'fade-out': 'Fade Out', + }, +}; diff --git a/www/src/Locales/en/Index.jsx b/www/src/Locales/en/Index.jsx index cc394cfb5..743d868a7 100644 --- a/www/src/Locales/en/Index.jsx +++ b/www/src/Locales/en/Index.jsx @@ -15,6 +15,7 @@ import CaptureButton from './CaptureButton'; import WiiAddon from './Addons/WiiAddon'; import Rotary from './Addons/Rotary'; import PCF8575 from './Addons/PCF8575'; +import ReactiveLED from './Addons/ReactiveLED'; import InputMacroAddon from './InputMacroAddon'; import LayoutConfig from './LayoutConfig'; @@ -38,4 +39,5 @@ export default { InputMacroAddon, LayoutConfig, PCF8575, + ReactiveLED, }; diff --git a/www/src/Locales/en/SettingsPage.jsx b/www/src/Locales/en/SettingsPage.jsx index 2818ce32c..2360e56db 100644 --- a/www/src/Locales/en/SettingsPage.jsx +++ b/www/src/Locales/en/SettingsPage.jsx @@ -108,6 +108,10 @@ export default { 'a2-button': 'A2 Button', 'a3-button': 'A3 Button', 'a4-button': 'A4 Button', + 'dpad-up': 'Dpad Up', + 'dpad-down': 'Dpad Down', + 'dpad-left': 'Dpad Left', + 'dpad-right': 'Dpad Right', 'touchpad-button': 'Touchpad Button', 'load-profile-1': 'Load Profile #1', 'load-profile-2': 'Load Profile #2', diff --git a/www/src/Pages/AddonsConfigPage.jsx b/www/src/Pages/AddonsConfigPage.jsx index 376ab012d..382e4f048 100644 --- a/www/src/Pages/AddonsConfigPage.jsx +++ b/www/src/Pages/AddonsConfigPage.jsx @@ -55,6 +55,7 @@ import DRV8833Rumble, { drv8833RumbleScheme, drv8833RumbleState, } from '../Addons/DRV8833'; +import ReactiveLED, { reactiveLEDScheme, reactiveLEDState } from '../Addons/ReactiveLED'; const schema = yup.object().shape({ ...analogScheme, @@ -77,6 +78,7 @@ const schema = yup.object().shape({ ...rotaryScheme, ...pcf8575Scheme, ...drv8833RumbleScheme, + ...reactiveLEDScheme, }); const defaultValues = { @@ -101,6 +103,7 @@ const defaultValues = { ...rotaryState, ...pcf8575State, ...drv8833RumbleState, + ...reactiveLEDState, }; const ADDONS = [ @@ -125,6 +128,7 @@ const ADDONS = [ Rotary, PCF8575, DRV8833Rumble, + ReactiveLED, ]; const FormContext = ({ setStoredData }) => { diff --git a/www/src/Pages/SettingsPage.jsx b/www/src/Pages/SettingsPage.jsx index 83a120157..d29c1e323 100644 --- a/www/src/Pages/SettingsPage.jsx +++ b/www/src/Pages/SettingsPage.jsx @@ -265,6 +265,10 @@ const HOTKEY_ACTIONS = [ { labelKey: 'hotkey-actions.a2-button', value: 34 }, { labelKey: 'hotkey-actions.a3-button', value: 36 }, { labelKey: 'hotkey-actions.a4-button', value: 37 }, + { labelKey: 'hotkey-actions.dpad-up', value: 38 }, + { labelKey: 'hotkey-actions.dpad-down', value: 39 }, + { labelKey: 'hotkey-actions.dpad-left', value: 40 }, + { labelKey: 'hotkey-actions.dpad-right', value: 41 }, ]; const FORCED_SETUP_MODES = [ @@ -1451,6 +1455,21 @@ export default function SettingsPage() { {errors[o] && errors[o]?.action} + {Boolean( + values[o]?.buttonsMask || values[o]?.action, + ) && ( + + + + )} ))} diff --git a/www/src/Services/WebApi.js b/www/src/Services/WebApi.js index 57d052d7c..92416d180 100644 --- a/www/src/Services/WebApi.js +++ b/www/src/Services/WebApi.js @@ -565,6 +565,22 @@ async function setWiiControls(mappings) { }); } +async function getReactiveLEDs(setLoading) { + setLoading(true); + try { + const response = await Http.get(`${baseUrl}/api/getReactiveLEDs`); + return response.data; + } catch (error) { + console.error(error); + } +} + +async function setReactiveLEDs(leds) { + console.dir(leds); + + return Http.post(`${baseUrl}/api/setReactiveLEDs`, leds); +} + async function getPeripheralOptions(setLoading) { setLoading(true); try { @@ -710,6 +726,8 @@ export default { setPeripheralOptions, getExpansionPins, setExpansionPins, + getReactiveLEDs, + setReactiveLEDs, getButtonLayouts, getButtonLayoutDefs, getSplashImage,