Skip to content

Commit

Permalink
add boardconfig for ergoSHIFT Rev.2 (OpenStickCommunity#1024)
Browse files Browse the repository at this point in the history
* add boardconfig for ergoSHIFT Rev.2

* Update cmake.yml

Removing arbitrary space at the bottom

---------

Co-authored-by: Luke A <[email protected]>
  • Loading branch information
mizma and arntsonl authored Jun 5, 2024
1 parent 58d38ab commit c1dbd5c
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
GP2040_BOARDCONFIG: [ARCController, Blank, Pico, PicoW, BentoBox, FightboardV3, FightboardV3Mirrored, FlatboxRev4, FlatboxRev5, FlatboxRev5RGB, FlatboxRev5Southpaw, Granola, KB2040, KeyboardConverter, Haute42COSMOX, Liatris, MavercadeRev1, MavercadeRev2, 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, FlatboxRev5Southpaw, Granola, KB2040, KeyboardConverter, Haute42COSMOX, Liatris, MavercadeRev1, MavercadeRev2, OpenCore0, OpenCore0WASD, PicoAnn, PicoFightingBoard, RanaTadpole, ReflexCtrlGenesis6, ReflexCtrlNES, ReflexCtrlSaturn, ReflexCtrlSNES, ReflexCtrlVB, ReflexEncodeV1.2, ReflexEncodeV2.0, RP2040AdvancedBreakoutBoard, RP2040AdvancedBreakoutBoardUSBPassthrough, RP2040MiniBreakoutBoard, SparkFunProMicro, WaveshareZero, Stress, SGFDevices, ZeroRhythm]

steps:
#Global Setup
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
name: GP2040-CE - ${{ matrix.GP2040_BOARDCONFIG }}
path: ${{github.workspace}}/build/GP2040-CE_*_${{ matrix.GP2040_BOARDCONFIG }}.uf2
if-no-files-found: error

- name: Upload .elf Artifact
if: ${{ matrix.GP2040_BOARDCONFIG == 'Pico'}}
uses: actions/[email protected]
Expand Down
149 changes: 149 additions & 0 deletions configs/ergoSHIFTRev2/BoardConfig.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/*
* 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 "ergoSHIFT Rev.2"

// Main pin mapping Configuration
// // GP2040 | Xinput | Switch | PS3/4/5 | Dinput | Arcade |
#define GPIO_PIN_12 GpioAction::BUTTON_PRESS_UP // UP | UP | UP | UP | UP | UP |
#define GPIO_PIN_09 GpioAction::BUTTON_PRESS_DOWN // DOWN | DOWN | DOWN | DOWN | DOWN | DOWN |
#define GPIO_PIN_11 GpioAction::BUTTON_PRESS_RIGHT // RIGHT | RIGHT | RIGHT | RIGHT | RIGHT | RIGHT |
#define GPIO_PIN_06 GpioAction::BUTTON_PRESS_LEFT // LEFT | LEFT | LEFT | LEFT | LEFT | LEFT |
#define GPIO_PIN_18 GpioAction::BUTTON_PRESS_B1 // B1 | A | B | Cross | 2 | K1 |
#define GPIO_PIN_19 GpioAction::BUTTON_PRESS_B2 // B2 | B | A | Circle | 3 | K2 |
#define GPIO_PIN_23 GpioAction::BUTTON_PRESS_R2 // R2 | RT | ZR | R2 | 8 | K3 |
#define GPIO_PIN_16 GpioAction::BUTTON_PRESS_L2 // L2 | LT | ZL | L2 | 7 | K4 |
#define GPIO_PIN_20 GpioAction::BUTTON_PRESS_B3 // B3 | X | Y | Square | 1 | P1 |
#define GPIO_PIN_25 GpioAction::BUTTON_PRESS_B4 // B4 | Y | X | Triangle | 4 | P2 |
#define GPIO_PIN_26 GpioAction::BUTTON_PRESS_R1 // R1 | RB | R | R1 | 6 | P3 |
#define GPIO_PIN_24 GpioAction::BUTTON_PRESS_L1 // L1 | LB | L | L1 | 5 | P4 |
#define GPIO_PIN_27 GpioAction::BUTTON_PRESS_S1 // S1 | Back | Minus | Select | 9 | Coin |
#define GPIO_PIN_00 GpioAction::BUTTON_PRESS_S2 // S2 | Start | Plus | Start | 10 | Start |
#define GPIO_PIN_10 GpioAction::BUTTON_PRESS_L3 // L3 | LS | LS | L3 | 11 | LS |
#define GPIO_PIN_17 GpioAction::BUTTON_PRESS_R3 // R3 | RS | RS | R3 | 12 | RS |
#define GPIO_PIN_02 GpioAction::BUTTON_PRESS_A1 // A1 | Guide | Home | PS | 13 | ~ |
#define GPIO_PIN_01 GpioAction::BUTTON_PRESS_A2 // A2 | ~ | Capture | ~ | 14 | ~ |

// Setting GPIO pins to assigned by add-on
//
#define GPIO_PIN_04 GpioAction::ASSIGNED_TO_ADDON
#define GPIO_PIN_05 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 HAS_I2C_DISPLAY 1
#define I2C0_ENABLED 1
#define I2C0_PIN_SDA 4
#define I2C0_PIN_SCL 5
#define DISPLAY_I2C_BLOCK i2c0
#define DISPLAY_FLIP 0
#define DISPLAY_INVERT 0

#define BUTTON_LAYOUT BUTTON_LAYOUT_STICKLESS
#define BUTTON_LAYOUT_RIGHT BUTTON_LAYOUT_STICKLESSB
#define SPLASH_MODE SPLASH_MODE_STATIC
#define SPLASH_DURATION 7500

/**
* Made with Marlin Bitmap Converter
* https://marlinfw.org/tools/u8glib/converter.html
*
* This bitmap from the file 'ErgoSHIFT-logo-128x64.bmp'
*/

#define DEFAULT_SPLASH \
0xFF,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FF,0xFC,0x00,0x00,0x00,0xFF,0x80,0x00,0x00,0x07,0xFF,0xFF, \
0xFE,0xFC,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0xFF,0xE0,0x00,0x00,0x0F,0xFF,0xFF, \
0xFE,0x01,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0xFF,0xF0,0x00,0x00,0x1F,0xFF,0xFF, \
0xFF,0x3F,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0xFF,0xFC,0x00,0x00,0x3F,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x01,0xFF,0xFF,0x80,0x00,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x03,0xFF,0xFF,0xF8,0x07,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x01,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, \
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF


#endif
10 changes: 10 additions & 0 deletions configs/ergoSHIFTRev2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# GP2040 Configuration for the ergoSHIFT Rev.2

![ergoSHIFT Rev.2](./assets/ergoSHIFT-rev2-bare1.jpg)

Configuration for the [ergoSHIFT Rev.2](https://github.com/mizma/ergoSHIFT/tree/main/hardware-rev2), a 4+11 button lever-less
arcade controller designed by [mizma](https://github.com/mizma/).

## Button mapping

![ergoSHIFT Rev.2 button mapping](./assets/ergoSHIFT-rev2-button-mapping.jpg)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions configs/ergoSHIFTRev2/ergoshiftrev2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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_ERGOSHIFTREV2_H
#define _BOARDS_ERGOSHIFTREV2_H

// For board detection
#define ERGOSHIFTREV2

// For crappy crystal
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
#endif

#endif

0 comments on commit c1dbd5c

Please sign in to comment.