From 0b82e52ef8d6aa9425b58dfba65ba27f0842cd89 Mon Sep 17 00:00:00 2001 From: Ilya Zhuravlev Date: Sun, 11 Sep 2022 18:02:52 -0600 Subject: [PATCH] Add vial_example/vial_rp2040 --- keyboards/vial_example/vial_rp2040/config.h | 24 ++++++++++++++++++ .../vial_rp2040/keymaps/default/keymap.c | 15 +++++++++++ .../vial_rp2040/keymaps/vial/config.h | 7 ++++++ .../vial_rp2040/keymaps/vial/keymap.c | 25 +++++++++++++++++++ .../vial_rp2040/keymaps/vial/rules.mk | 2 ++ .../vial_rp2040/keymaps/vial/vial.json | 18 +++++++++++++ keyboards/vial_example/vial_rp2040/rules.mk | 23 +++++++++++++++++ .../vial_example/vial_rp2040/vial_rp2040.c | 3 +++ .../vial_example/vial_rp2040/vial_rp2040.h | 13 ++++++++++ 9 files changed, 130 insertions(+) create mode 100644 keyboards/vial_example/vial_rp2040/config.h create mode 100644 keyboards/vial_example/vial_rp2040/keymaps/default/keymap.c create mode 100644 keyboards/vial_example/vial_rp2040/keymaps/vial/config.h create mode 100644 keyboards/vial_example/vial_rp2040/keymaps/vial/keymap.c create mode 100644 keyboards/vial_example/vial_rp2040/keymaps/vial/rules.mk create mode 100644 keyboards/vial_example/vial_rp2040/keymaps/vial/vial.json create mode 100644 keyboards/vial_example/vial_rp2040/rules.mk create mode 100644 keyboards/vial_example/vial_rp2040/vial_rp2040.c create mode 100644 keyboards/vial_example/vial_rp2040/vial_rp2040.h diff --git a/keyboards/vial_example/vial_rp2040/config.h b/keyboards/vial_example/vial_rp2040/config.h new file mode 100644 index 0000000000..697c59a1d1 --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/config.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Vial +#define PRODUCT RP2040 example + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 2 + +#define MATRIX_ROW_PINS { GP2, GP4 } +#define MATRIX_COL_PINS { GP3, GP5 } + +#define DIODE_DIRECTION COL2ROW + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/vial_example/vial_rp2040/keymaps/default/keymap.c b/keyboards/vial_example/vial_rp2040/keymaps/default/keymap.c new file mode 100644 index 0000000000..6c76cbf73d --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/default/keymap.c @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_1, KC_2, + KC_3, KC_4 + ), + + [1] = LAYOUT( + KC_A, KC_B, + KC_C, KC_D + ) +}; diff --git a/keyboards/vial_example/vial_rp2040/keymaps/vial/config.h b/keyboards/vial_example/vial_rp2040/keymaps/vial/config.h new file mode 100644 index 0000000000..3dcca90a7e --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/vial/config.h @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#define VIAL_KEYBOARD_UID {0x0F, 0xB0, 0xD3, 0xDF, 0x7B, 0x86, 0xA6, 0x00} +#define VIAL_UNLOCK_COMBO_ROWS { 0, 1 } +#define VIAL_UNLOCK_COMBO_COLS { 0, 1 } diff --git a/keyboards/vial_example/vial_rp2040/keymaps/vial/keymap.c b/keyboards/vial_example/vial_rp2040/keymaps/vial/keymap.c new file mode 100644 index 0000000000..c8fb892589 --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/vial/keymap.c @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_1, KC_2, + KC_3, KC_4 + ), + + [1] = LAYOUT( + KC_A, KC_B, + KC_C, KC_D + ), + + [2] = LAYOUT( + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS + ), + + [3] = LAYOUT( + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS + ) +}; diff --git a/keyboards/vial_example/vial_rp2040/keymaps/vial/rules.mk b/keyboards/vial_example/vial_rp2040/keymaps/vial/rules.mk new file mode 100644 index 0000000000..4f7618e9b2 --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/vial/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +VIAL_ENABLE = yes diff --git a/keyboards/vial_example/vial_rp2040/keymaps/vial/vial.json b/keyboards/vial_example/vial_rp2040/keymaps/vial/vial.json new file mode 100644 index 0000000000..7525baeac5 --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/keymaps/vial/vial.json @@ -0,0 +1,18 @@ +{ + "matrix": { + "rows": 2, + "cols": 2 + }, + "layouts": { + "keymap": [ + [ + "0,0", + "0,1" + ], + [ + "1,0", + "1,1" + ] + ] + } +} diff --git a/keyboards/vial_example/vial_rp2040/rules.mk b/keyboards/vial_example/vial_rp2040/rules.mk new file mode 100644 index 0000000000..34863972e2 --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = RP2040 +BOOTLOADER = rp2040 + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches diff --git a/keyboards/vial_example/vial_rp2040/vial_rp2040.c b/keyboards/vial_example/vial_rp2040/vial_rp2040.c new file mode 100644 index 0000000000..2ffcfd355d --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/vial_rp2040.c @@ -0,0 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "vial_rp2040.h" diff --git a/keyboards/vial_example/vial_rp2040/vial_rp2040.h b/keyboards/vial_example/vial_rp2040/vial_rp2040.h new file mode 100644 index 0000000000..12c2bedb5f --- /dev/null +++ b/keyboards/vial_example/vial_rp2040/vial_rp2040.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, \ + K10, K11 \ +) { \ + { K00, K01 }, \ + { K10, K11 } \ +}