diff --git a/CMakeLists.txt b/CMakeLists.txt index 89ca2af4e..ec662240a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,19 @@ +# == DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work == +if(WIN32) + set(USERHOME $ENV{USERPROFILE}) +else() + set(USERHOME $ENV{HOME}) +endif() +set(sdkVersion 2.1.0) +set(toolchainVersion 13_3_Rel1) +set(picotoolVersion 2.1.0) +set(picoVscode ${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake) +if (EXISTS ${picoVscode}) + include(${picoVscode}) +endif() +# ==================================================================================== +set(PICO_BOARD pimoroni_pico_plus2_rp2350 CACHE STRING "Board type") + cmake_minimum_required(VERSION 3.13) include(CMakePrintHelpers) @@ -39,7 +55,7 @@ set(CMAKE_CXX_STANDARD 17) if(DEFINED ENV{GP2040_BOARDCONFIG}) set(GP2040_BOARDCONFIG $ENV{GP2040_BOARDCONFIG}) elseif(NOT DEFINED GP2040_BOARDCONFIG) - set(GP2040_BOARDCONFIG Pico) + set(GP2040_BOARDCONFIG PicoPlus2) endif() if(DEFINED ENV{SKIP_SUBMODULES}) diff --git a/configs/Pico2/BoardConfig.h b/configs/Pico2/BoardConfig.h new file mode 100644 index 000000000..08dba54d8 --- /dev/null +++ b/configs/Pico2/BoardConfig.h @@ -0,0 +1,98 @@ +/* + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: Copyright (c) 2024 OpenStickCommunity (gp2040-ce.info) + */ + +#ifndef PICO2_BOARD_CONFIG_H_ +#define PICO2_BOARD_CONFIG_H_ + +#include "enums.pb.h" +#include "class/hid/hid.h" + +#define BOARD_CONFIG_LABEL "Pico2" + +// 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_05 GpioAction::BUTTON_PRESS_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +#define GPIO_PIN_06 GpioAction::BUTTON_PRESS_B1 // B1 | A | B | Cross | 2 | K1 | +#define GPIO_PIN_07 GpioAction::BUTTON_PRESS_B2 // B2 | B | A | Circle | 3 | K2 | +#define GPIO_PIN_08 GpioAction::BUTTON_PRESS_R2 // R2 | RT | ZR | R2 | 8 | K3 | +#define GPIO_PIN_09 GpioAction::BUTTON_PRESS_L2 // L2 | LT | ZL | L2 | 7 | K4 | +#define GPIO_PIN_10 GpioAction::BUTTON_PRESS_B3 // B3 | X | Y | Square | 1 | P1 | +#define GPIO_PIN_11 GpioAction::BUTTON_PRESS_B4 // B4 | Y | X | Triangle | 4 | P2 | +#define GPIO_PIN_12 GpioAction::BUTTON_PRESS_R1 // R1 | RB | R | R1 | 6 | P3 | +#define GPIO_PIN_13 GpioAction::BUTTON_PRESS_L1 // L1 | LB | L | L1 | 5 | P4 | +#define GPIO_PIN_16 GpioAction::BUTTON_PRESS_S1 // S1 | Back | Minus | Select | 9 | Coin | +#define GPIO_PIN_17 GpioAction::BUTTON_PRESS_S2 // S2 | Start | Plus | Start | 10 | Start | +#define GPIO_PIN_18 GpioAction::BUTTON_PRESS_L3 // L3 | LS | LS | L3 | 11 | LS | +#define GPIO_PIN_19 GpioAction::BUTTON_PRESS_R3 // R3 | RS | RS | R3 | 12 | RS | +#define GPIO_PIN_20 GpioAction::BUTTON_PRESS_A1 // A1 | Guide | Home | PS | 13 | ~ | +#define GPIO_PIN_21 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_01 GpioAction::ASSIGNED_TO_ADDON +#define GPIO_PIN_15 GpioAction::ASSIGNED_TO_ADDON +#define GPIO_PIN_28 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 | +#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 | + +#define TURBO_ENABLED 1 +#define GPIO_PIN_14 GpioAction::BUTTON_PRESS_TURBO +#define TURBO_LED_PIN 15 + +#define BOARD_LEDS_PIN 28 +#define LED_BRIGHTNESS_MAXIMUM 100 +#define LED_BRIGHTNESS_STEPS 5 +#define LED_FORMAT LED_FORMAT_GRB +#define LEDS_PER_PIXEL 1 + +#define LEDS_DPAD_LEFT 0 +#define LEDS_DPAD_DOWN 1 +#define LEDS_DPAD_RIGHT 2 +#define LEDS_DPAD_UP 3 +#define LEDS_BUTTON_B3 4 +#define LEDS_BUTTON_B4 5 +#define LEDS_BUTTON_R1 6 +#define LEDS_BUTTON_L1 7 +#define LEDS_BUTTON_B1 8 +#define LEDS_BUTTON_B2 9 +#define LEDS_BUTTON_R2 10 +#define LEDS_BUTTON_L2 11 +#define LEDS_BUTTON_A1 12 +#define LEDS_BUTTON_L3 13 +#define LEDS_BUTTON_R3 14 +#define LEDS_BUTTON_A2 15 + +#define HAS_I2C_DISPLAY 1 +#define I2C0_ENABLED 1 +#define I2C0_PIN_SDA 0 +#define I2C0_PIN_SCL 1 +#define BUTTON_LAYOUT BUTTON_LAYOUT_STICKLESS +#define BUTTON_LAYOUT_RIGHT BUTTON_LAYOUT_STICKLESSB + +#endif \ No newline at end of file diff --git a/configs/Pico2/CMakeLists.txt b/configs/Pico2/CMakeLists.txt new file mode 100644 index 000000000..c26e3683a --- /dev/null +++ b/configs/Pico2/CMakeLists.txt @@ -0,0 +1,3 @@ +#add_executable(Pico +#${CMAKE_SOURCE_DIR}/src/main.cpp) +#link_libraries(${PROJECT_NAME}) \ No newline at end of file diff --git a/configs/Pico2/README.md b/configs/Pico2/README.md new file mode 100644 index 000000000..55f6a7527 --- /dev/null +++ b/configs/Pico2/README.md @@ -0,0 +1,28 @@ +# GP2040 Configuration for Raspberry Pi Pico + +![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/Pico2/assets/PinMapping.png b/configs/Pico2/assets/PinMapping.png new file mode 100644 index 000000000..1de4c71c5 Binary files /dev/null and b/configs/Pico2/assets/PinMapping.png differ diff --git a/configs/Pico2/assets/PinMapping.xcf b/configs/Pico2/assets/PinMapping.xcf new file mode 100644 index 000000000..84ee57ba6 Binary files /dev/null and b/configs/Pico2/assets/PinMapping.xcf differ diff --git a/configs/PicoPlus2/BoardConfig.h b/configs/PicoPlus2/BoardConfig.h new file mode 100644 index 000000000..380e8ca16 --- /dev/null +++ b/configs/PicoPlus2/BoardConfig.h @@ -0,0 +1,140 @@ +/* + * SPDX-License-Identifier: MIT + * SPDX-FileCopyrightText: Copyright (c) 2024 OpenStickCommunity (gp2040-ce.info) + */ + +// pico_cmake_set PICO_PLATFORM=rp2350 +// pico_cmake_set PICO_CYW43_SUPPORTED = 1 + +#ifndef PICOPLUS2_BOARD_CONFIG_H_ +#define PICOPLUS2_BOARD_CONFIG_H_ + +#include "enums.pb.h" +#include "class/hid/hid.h" + +#define BOARD_CONFIG_LABEL "PicoPlus2" + +#ifndef PICO_FLASH_SIZE_BYTES +#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024) +#endif +#ifndef PICO_RP2350_A2_SUPPORTED +#define PICO_RP2350_A2_SUPPORTED 1 +#endif +// gpio pin to power up the cyw43 chip +#ifndef CYW43_DEFAULT_PIN_WL_REG_ON +#define CYW43_DEFAULT_PIN_WL_REG_ON 32 +#endif + +// gpio pin for spi data out to the cyw43 chip +#ifndef CYW43_DEFAULT_PIN_WL_DATA_OUT +#define CYW43_DEFAULT_PIN_WL_DATA_OUT 35 +#endif + +// gpio pin for spi data in from the cyw43 chip +#ifndef CYW43_DEFAULT_PIN_WL_DATA_IN +#define CYW43_DEFAULT_PIN_WL_DATA_IN 35 +#endif + +// gpio (irq) pin for the irq line from the cyw43 chip +#ifndef CYW43_DEFAULT_PIN_WL_HOST_WAKE +#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 35 +#endif + +// gpio pin for the spi clock line to the cyw43 chip +#ifndef CYW43_DEFAULT_PIN_WL_CLOCK +#define CYW43_DEFAULT_PIN_WL_CLOCK 34 +#endif + +// gpio pin for the spi chip select to the cyw43 chip +#ifndef CYW43_DEFAULT_PIN_WL_CS +#define CYW43_DEFAULT_PIN_WL_CS 33 +#endif + +#ifndef CYW43_WL_GPIO_COUNT +#define CYW43_WL_GPIO_COUNT 3 +#endif +// 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_05 GpioAction::BUTTON_PRESS_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT | +#define GPIO_PIN_06 GpioAction::BUTTON_PRESS_B1 // B1 | A | B | Cross | 2 | K1 | +#define GPIO_PIN_07 GpioAction::BUTTON_PRESS_B2 // B2 | B | A | Circle | 3 | K2 | +#define GPIO_PIN_08 GpioAction::BUTTON_PRESS_R2 // R2 | RT | ZR | R2 | 8 | K3 | +#define GPIO_PIN_09 GpioAction::BUTTON_PRESS_L2 // L2 | LT | ZL | L2 | 7 | K4 | +#define GPIO_PIN_10 GpioAction::BUTTON_PRESS_B3 // B3 | X | Y | Square | 1 | P1 | +#define GPIO_PIN_11 GpioAction::BUTTON_PRESS_B4 // B4 | Y | X | Triangle | 4 | P2 | +#define GPIO_PIN_12 GpioAction::BUTTON_PRESS_R1 // R1 | RB | R | R1 | 6 | P3 | +#define GPIO_PIN_13 GpioAction::BUTTON_PRESS_L1 // L1 | LB | L | L1 | 5 | P4 | +#define GPIO_PIN_16 GpioAction::BUTTON_PRESS_S1 // S1 | Back | Minus | Select | 9 | Coin | +#define GPIO_PIN_17 GpioAction::BUTTON_PRESS_S2 // S2 | Start | Plus | Start | 10 | Start | +#define GPIO_PIN_18 GpioAction::BUTTON_PRESS_L3 // L3 | LS | LS | L3 | 11 | LS | +#define GPIO_PIN_19 GpioAction::BUTTON_PRESS_R3 // R3 | RS | RS | R3 | 12 | RS | +#define GPIO_PIN_20 GpioAction::BUTTON_PRESS_A1 // A1 | Guide | Home | PS | 13 | ~ | +#define GPIO_PIN_21 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_01 GpioAction::ASSIGNED_TO_ADDON +#define GPIO_PIN_15 GpioAction::ASSIGNED_TO_ADDON +#define GPIO_PIN_28 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 | +#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 | + +#define TURBO_ENABLED 1 +#define GPIO_PIN_14 GpioAction::BUTTON_PRESS_TURBO +#define TURBO_LED_PIN 15 + +#define BOARD_LEDS_PIN 28 +#define LED_BRIGHTNESS_MAXIMUM 100 +#define LED_BRIGHTNESS_STEPS 5 +#define LED_FORMAT LED_FORMAT_GRB +#define LEDS_PER_PIXEL 1 + +#define LEDS_DPAD_LEFT 0 +#define LEDS_DPAD_DOWN 1 +#define LEDS_DPAD_RIGHT 2 +#define LEDS_DPAD_UP 3 +#define LEDS_BUTTON_B3 4 +#define LEDS_BUTTON_B4 5 +#define LEDS_BUTTON_R1 6 +#define LEDS_BUTTON_L1 7 +#define LEDS_BUTTON_B1 8 +#define LEDS_BUTTON_B2 9 +#define LEDS_BUTTON_R2 10 +#define LEDS_BUTTON_L2 11 +#define LEDS_BUTTON_A1 12 +#define LEDS_BUTTON_L3 13 +#define LEDS_BUTTON_R3 14 +#define LEDS_BUTTON_A2 15 + +#define HAS_I2C_DISPLAY 1 +#define I2C0_ENABLED 1 +#define I2C0_PIN_SDA 0 +#define I2C0_PIN_SCL 1 +#define BUTTON_LAYOUT BUTTON_LAYOUT_STICKLESS +#define BUTTON_LAYOUT_RIGHT BUTTON_LAYOUT_STICKLESSB + +#endif \ No newline at end of file diff --git a/configs/PicoPlus2/CMakeLists.txt b/configs/PicoPlus2/CMakeLists.txt new file mode 100644 index 000000000..c26e3683a --- /dev/null +++ b/configs/PicoPlus2/CMakeLists.txt @@ -0,0 +1,3 @@ +#add_executable(Pico +#${CMAKE_SOURCE_DIR}/src/main.cpp) +#link_libraries(${PROJECT_NAME}) \ No newline at end of file diff --git a/configs/PicoPlus2/README.md b/configs/PicoPlus2/README.md new file mode 100644 index 000000000..55f6a7527 --- /dev/null +++ b/configs/PicoPlus2/README.md @@ -0,0 +1,28 @@ +# GP2040 Configuration for Raspberry Pi Pico + +![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/PicoPlus2/assets/PinMapping.png b/configs/PicoPlus2/assets/PinMapping.png new file mode 100644 index 000000000..1de4c71c5 Binary files /dev/null and b/configs/PicoPlus2/assets/PinMapping.png differ diff --git a/configs/PicoPlus2/assets/PinMapping.xcf b/configs/PicoPlus2/assets/PinMapping.xcf new file mode 100644 index 000000000..84ee57ba6 Binary files /dev/null and b/configs/PicoPlus2/assets/PinMapping.xcf differ diff --git a/lib/NeoPico/src/generated/ws2812.pio.h b/lib/NeoPico/src/generated/ws2812.pio.h index 8cbeea6b7..fbe0c104f 100644 --- a/lib/NeoPico/src/generated/ws2812.pio.h +++ b/lib/NeoPico/src/generated/ws2812.pio.h @@ -14,6 +14,7 @@ #define ws2812_wrap_target 0 #define ws2812_wrap 3 +#define ws2812_pio_version 1 #define ws2812_T1 2 #define ws2812_T2 5 @@ -33,6 +34,10 @@ static const struct pio_program ws2812_program = { .instructions = ws2812_program_instructions, .length = 4, .origin = -1, + .pio_version = ws2812_pio_version, +#if PICO_PIO_VERSION > 0 + .used_gpio_ranges = 0x0 +#endif }; static inline pio_sm_config ws2812_program_get_default_config(uint offset) { @@ -65,6 +70,7 @@ static inline void ws2812_program_init(PIO pio, uint sm, uint offset, uint pin, #define ws2812_parallel_wrap_target 0 #define ws2812_parallel_wrap 3 +#define ws2812_parallel_pio_version 1 #define ws2812_parallel_T1 2 #define ws2812_parallel_T2 5 @@ -84,6 +90,10 @@ static const struct pio_program ws2812_parallel_program = { .instructions = ws2812_parallel_program_instructions, .length = 4, .origin = -1, + .pio_version = ws2812_parallel_pio_version, +#if PICO_PIO_VERSION > 0 + .used_gpio_ranges = 0x0 +#endif }; static inline pio_sm_config ws2812_parallel_program_get_default_config(uint offset) { diff --git a/lib/WiiExtension/WiiExtension.h b/lib/WiiExtension/WiiExtension.h index bd67b11fd..e158821b3 100644 --- a/lib/WiiExtension/WiiExtension.h +++ b/lib/WiiExtension/WiiExtension.h @@ -90,7 +90,7 @@ typedef enum { #endif #define WII_ALARM_NUM 0 -#define WII_ALARM_IRQ TIMER_IRQ_0 +#define WII_ALARM_IRQ TIMER1_IRQ_0 #define WII_CHECKSUM_MAGIC 0x55 #define WII_CALIBRATION_SIZE 0x10 diff --git a/lib/pico_pio_usb b/lib/pico_pio_usb index 0f747aaa0..fe9133fc5 160000 --- a/lib/pico_pio_usb +++ b/lib/pico_pio_usb @@ -1 +1 @@ -Subproject commit 0f747aaa0c16f750bdfa2ba37ec25d6c8e1bc117 +Subproject commit fe9133fc513b82cc3dc62c67cb51f2339cf29ef7 diff --git a/lib/tinyusb b/lib/tinyusb index 5217cee5d..86ad6e56c 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit 5217cee5de4cd555018da90f9f1bcc87fb1c1d3a +Subproject commit 86ad6e56c1700e85f1c5678607a762cfe3aa2f47 diff --git a/pico_sdk_import.cmake b/pico_sdk_import.cmake index 65f8a6f7d..a0721d0d1 100644 --- a/pico_sdk_import.cmake +++ b/pico_sdk_import.cmake @@ -18,9 +18,20 @@ if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_PATH} AND (NOT PICO_SDK_FETCH_FROM_GIT_P message("Using PICO_SDK_FETCH_FROM_GIT_PATH from environment ('${PICO_SDK_FETCH_FROM_GIT_PATH}')") endif () +if (DEFINED ENV{PICO_SDK_FETCH_FROM_GIT_TAG} AND (NOT PICO_SDK_FETCH_FROM_GIT_TAG)) + set(PICO_SDK_FETCH_FROM_GIT_TAG $ENV{PICO_SDK_FETCH_FROM_GIT_TAG}) + message("Using PICO_SDK_FETCH_FROM_GIT_TAG from environment ('${PICO_SDK_FETCH_FROM_GIT_TAG}')") +endif () + +if (PICO_SDK_FETCH_FROM_GIT AND NOT PICO_SDK_FETCH_FROM_GIT_TAG) + set(PICO_SDK_FETCH_FROM_GIT_TAG "master") + message("Using master as default value for PICO_SDK_FETCH_FROM_GIT_TAG") +endif() + set(PICO_SDK_PATH "${PICO_SDK_PATH}" CACHE PATH "Path to the Raspberry Pi Pico SDK") set(PICO_SDK_FETCH_FROM_GIT "${PICO_SDK_FETCH_FROM_GIT}" CACHE BOOL "Set to ON to fetch copy of SDK from git if not otherwise locatable") set(PICO_SDK_FETCH_FROM_GIT_PATH "${PICO_SDK_FETCH_FROM_GIT_PATH}" CACHE FILEPATH "location to download SDK") +set(PICO_SDK_FETCH_FROM_GIT_TAG "${PICO_SDK_FETCH_FROM_GIT_TAG}" CACHE FILEPATH "release tag for SDK") if (NOT PICO_SDK_PATH) if (PICO_SDK_FETCH_FROM_GIT) @@ -34,14 +45,14 @@ if (NOT PICO_SDK_PATH) FetchContent_Declare( pico_sdk GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk - GIT_TAG master + GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} GIT_SUBMODULES_RECURSE FALSE ) else () FetchContent_Declare( pico_sdk GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk - GIT_TAG master + GIT_TAG ${PICO_SDK_FETCH_FROM_GIT_TAG} ) endif () diff --git a/src/gp2040aux.cpp b/src/gp2040aux.cpp index 4a8e9db64..f2912efc9 100644 --- a/src/gp2040aux.cpp +++ b/src/gp2040aux.cpp @@ -43,7 +43,7 @@ void GP2040Aux::setup() { // Setup Add-ons addons.LoadAddon(new DisplayAddon(), CORE1_LOOP); - addons.LoadAddon(new NeoPicoLEDAddon(), CORE1_LOOP); + // addons.LoadAddon(new NeoPicoLEDAddon(), CORE1_LOOP); addons.LoadAddon(new PlayerLEDAddon(), CORE1_LOOP); addons.LoadAddon(new BoardLedAddon(), CORE1_LOOP); addons.LoadAddon(new BuzzerSpeakerAddon(), CORE1_LOOP);