From 664adc4437458004b5c5c8e25e0f969f00a2bf7b Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 17 Sep 2021 20:04:22 -0700 Subject: [PATCH 1/6] [Keyboard] Add Planck Drop board w/ custom matrix --- keyboards/planck/drop/chconf.h | 29 ++++ keyboards/planck/drop/config.h | 128 ++++++++++++++++ keyboards/planck/drop/drop.c | 44 ++++++ keyboards/planck/drop/drop.h | 108 +++++++++++++ keyboards/planck/drop/halconf.h | 22 +++ keyboards/planck/drop/info.json | 262 ++++++++++++++++++++++++++++++++ keyboards/planck/drop/matrix.c | 151 ++++++++++++++++++ keyboards/planck/drop/mcuconf.h | 39 +++++ keyboards/planck/drop/readme.md | 13 ++ keyboards/planck/drop/rules.mk | 34 +++++ keyboards/planck/planck.h | 43 ++++-- 11 files changed, 859 insertions(+), 14 deletions(-) create mode 100644 keyboards/planck/drop/chconf.h create mode 100644 keyboards/planck/drop/config.h create mode 100644 keyboards/planck/drop/drop.c create mode 100644 keyboards/planck/drop/drop.h create mode 100644 keyboards/planck/drop/halconf.h create mode 100644 keyboards/planck/drop/info.json create mode 100644 keyboards/planck/drop/matrix.c create mode 100644 keyboards/planck/drop/mcuconf.h create mode 100644 keyboards/planck/drop/readme.md create mode 100644 keyboards/planck/drop/rules.mk diff --git a/keyboards/planck/drop/chconf.h b/keyboards/planck/drop/chconf.h new file mode 100644 index 000000000000..e1243f23eca4 --- /dev/null +++ b/keyboards/planck/drop/chconf.h @@ -0,0 +1,29 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/planck/rev6/chconf.h -r platforms/chibios/QMK_PROTON_C/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_RESOLUTION 16 + +#define CH_CFG_ST_FREQUENCY 10000 + +#include_next + diff --git a/keyboards/planck/drop/config.h b/keyboards/planck/drop/config.h new file mode 100644 index 000000000000..022ab64608ef --- /dev/null +++ b/keyboards/planck/drop/config.h @@ -0,0 +1,128 @@ +/* + * Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +/* USB Device descriptor parameter */ +#define PRODUCT_ID 0xA4F9 +#define DEVICE_VER 0x0006 +#undef MANUFACTURER +#define MANUFACTURER OLKB + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +/* Note: These are not used for arm boards. They're here purely as documentation. */ +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS + +#define MATRIX_ROW_PINS \ + { A10, A9, A8, B15, C13, C14, C15, A2 } +#define MATRIX_COL_PINS \ + { B11, B10, B2, B1, A7, B0 } + +#define UNUSED_PINS + +#define ENCODERS_PAD_A \ + { B12 } +#define ENCODERS_PAD_B \ + { B13 } + +#define DIP_SWITCH_PINS \ + { B14, A15, A0, B9 } + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef AUDIO_PIN +#define AUDIO_PIN A5 +#define AUDIO_PIN_ALT A4 +#define AUDIO_PIN_ALT_AS_NEGATIVE + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +// #define DEBOUNCE 6 + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * WS2812 Underglow Matrix options + */ +#define RGB_DI_PIN A1 +#define RGBLED_NUM 9 +#define DRIVER_LED_TOTAL RGBLED_NUM + +#define WS2812_PWM_DRIVER PWMD2 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 +#define WS2812_DMA_CHANNEL 2 + +#define RGB_DISABLE_WHEN_USB_SUSPENDED diff --git a/keyboards/planck/drop/drop.c b/keyboards/planck/drop/drop.c new file mode 100644 index 000000000000..76a6cb84b78a --- /dev/null +++ b/keyboards/planck/drop/drop.c @@ -0,0 +1,44 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "drop.h" + +#ifdef RGB_MATRIX_ENABLE +// clang-format off +led_config_t g_led_config = { { + // Key Matrix to LED Index + { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 }, + { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED }, + { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED }, +}, { + // LED Index to Physical Position + {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60} +}, { + // LED Index to Flag + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL +} }; + +// LED physical location index +// 6 5 4 3 +// 0 +// 7 8 1 2 + +#endif diff --git a/keyboards/planck/drop/drop.h b/keyboards/planck/drop/drop.h new file mode 100644 index 000000000000..bc9434a02625 --- /dev/null +++ b/keyboards/planck/drop/drop.h @@ -0,0 +1,108 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include "planck.h" + +#define LAYOUT_planck_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, KC_NO } \ +} + +#define LAYOUT_planck_1x2uR( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { KC_NO, k37, k38, k33, k34, k35 } \ +} + +#define LAYOUT_planck_1x2uL( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, KC_NO, k35 } \ +} + +#define LAYOUT_planck_2x2u( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { KC_NO, k37, k38, k33, KC_NO, k35 } \ +} + +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k39, k3a, k3b }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k33, k34, k35 } \ +} + + +#define LAYOUT LAYOUT_ortho_4x12 +#define LAYOUT_planck_mit LAYOUT_planck_1x2uC +#define LAYOUT_planck_grid LAYOUT_ortho_4x12 diff --git a/keyboards/planck/drop/halconf.h b/keyboards/planck/drop/halconf.h new file mode 100644 index 000000000000..48b76d2f44e2 --- /dev/null +++ b/keyboards/planck/drop/halconf.h @@ -0,0 +1,22 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#define HAL_USE_PWM TRUE +#define HAL_USE_GPT TRUE +#define HAL_USE_DAC TRUE + +#include_next diff --git a/keyboards/planck/drop/info.json b/keyboards/planck/drop/info.json new file mode 100644 index 000000000000..114a971294cb --- /dev/null +++ b/keyboards/planck/drop/info.json @@ -0,0 +1,262 @@ +{ + "keyboard_name": "Planck rev 6", + "url": "https://olkb.com/planck", + "maintainer": "jackhumbert", + "layouts": { + "LAYOUT_ortho_4x12": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uC": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3, "w": 2 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uL": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3, "w": 2 }, + { "x": 6, "y": 3 }, + { "x": 7, "y": 3 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_1x2uR": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3 }, + { "x": 5, "y": 3 }, + { "x": 6, "y": 3, "w": 2 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + }, + "LAYOUT_planck_2x2u": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 3, "y": 0 }, + { "x": 4, "y": 0 }, + { "x": 5, "y": 0 }, + { "x": 6, "y": 0 }, + { "x": 7, "y": 0 }, + { "x": 8, "y": 0 }, + { "x": 9, "y": 0 }, + { "x": 10, "y": 0 }, + { "x": 11, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 }, + { "x": 3, "y": 1 }, + { "x": 4, "y": 1 }, + { "x": 5, "y": 1 }, + { "x": 6, "y": 1 }, + { "x": 7, "y": 1 }, + { "x": 8, "y": 1 }, + { "x": 9, "y": 1 }, + { "x": 10, "y": 1 }, + { "x": 11, "y": 1 }, + { "x": 0, "y": 2 }, + { "x": 1, "y": 2 }, + { "x": 2, "y": 2 }, + { "x": 3, "y": 2 }, + { "x": 4, "y": 2 }, + { "x": 5, "y": 2 }, + { "x": 6, "y": 2 }, + { "x": 7, "y": 2 }, + { "x": 8, "y": 2 }, + { "x": 9, "y": 2 }, + { "x": 10, "y": 2 }, + { "x": 11, "y": 2 }, + { "x": 0, "y": 3 }, + { "x": 1, "y": 3 }, + { "x": 2, "y": 3 }, + { "x": 3, "y": 3 }, + { "x": 4, "y": 3, "w": 2 }, + { "x": 6, "y": 3, "w": 2 }, + { "x": 8, "y": 3 }, + { "x": 9, "y": 3 }, + { "x": 10, "y": 3 }, + { "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/planck/drop/matrix.c b/keyboards/planck/drop/matrix.c new file mode 100644 index 000000000000..82631f4d3f69 --- /dev/null +++ b/keyboards/planck/drop/matrix.c @@ -0,0 +1,151 @@ +#include +#include +#include +#include "hal.h" +#include "timer.h" +#include "wait.h" +#include "printf.h" +#include "matrix.h" +#include "action.h" +#include "keycode.h" + +/* + * col: { B11, B10, B2, B1, A7, B0 } + * row: { A10, A9, A8, B15, C13, C14, C15, A2 } + */ +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_COLS]; +static bool debouncing = false; +static uint16_t debouncing_time = 0; + +__attribute__((weak)) void matrix_init_user(void) {} + +__attribute__((weak)) void matrix_scan_user(void) {} + +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } + +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } + +void matrix_init(void) { + printf("matrix init\n"); + // debug_matrix = true; + + // actual matrix setup + palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); + + palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 9, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 8, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOB, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 13, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 14, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN); + + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t)); + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + // actual matrix + for (int col = 0; col < MATRIX_COLS; col++) { + matrix_row_t data = 0; + + // strobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: + palSetPad(GPIOB, 11); + break; + case 1: + palSetPad(GPIOB, 10); + break; + case 2: + palSetPad(GPIOB, 2); + break; + case 3: + palSetPad(GPIOB, 1); + break; + case 4: + palSetPad(GPIOA, 7); + break; + case 5: + palSetPad(GPIOB, 0); + break; + } + + // need wait to settle pin state + wait_us(20); + + // read row data { A10, A9, A8, B15, C13, C14, C15, A2 } + data = ((palReadPad(GPIOA, 10) << 0) | (palReadPad(GPIOA, 9) << 1) | (palReadPad(GPIOA, 8) << 2) | (palReadPad(GPIOB, 15) << 3) | (palReadPad(GPIOC, 13) << 4) | (palReadPad(GPIOC, 14) << 5) | (palReadPad(GPIOC, 15) << 6) | (palReadPad(GPIOA, 2) << 7)); + + // unstrobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: + palClearPad(GPIOB, 11); + break; + case 1: + palClearPad(GPIOB, 10); + break; + case 2: + palClearPad(GPIOB, 2); + break; + case 3: + palClearPad(GPIOB, 1); + break; + case 4: + palClearPad(GPIOA, 7); + break; + case 5: + palClearPad(GPIOB, 0); + break; + } + + if (matrix_debouncing[col] != data) { + matrix_debouncing[col] = data; + debouncing = true; + debouncing_time = timer_read(); + } + } + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int row = 0; row < MATRIX_ROWS; row++) { + matrix[row] = 0; + for (int col = 0; col < MATRIX_COLS; col++) { + matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col); + } + } + debouncing = false; + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & (1 << col)); } + +matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } + +void matrix_print(void) { + printf("\nr/c 01234567\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + printf("%X0: ", row); + matrix_row_t data = matrix_get_row(row); + for (int col = 0; col < MATRIX_COLS; col++) { + if (data & (1 << col)) + printf("1"); + else + printf("0"); + } + printf("\n"); + } +} diff --git a/keyboards/planck/drop/mcuconf.h b/keyboards/planck/drop/mcuconf.h new file mode 100644 index 000000000000..31abf13b631d --- /dev/null +++ b/keyboards/planck/drop/mcuconf.h @@ -0,0 +1,39 @@ +/* Copyright 2020 QMK Contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include_next "mcuconf.h" + +// The SysTick timer from the normal quantum/stm32 uses TIM2 -- the WS2812 pin used +// on the Planck requires the use of TIM2 to run PWM -- rework which timers are +// allocated for PWM usage. +#undef STM32_PWM_USE_TIM2 +#define STM32_PWM_USE_TIM2 TRUE + +#undef STM32_DAC_USE_DAC1_CH1 +#define STM32_DAC_USE_DAC1_CH1 TRUE +#undef STM32_DAC_USE_DAC1_CH2 +#define STM32_DAC_USE_DAC1_CH2 TRUE +#undef STM32_GPT_USE_TIM6 +#define STM32_GPT_USE_TIM6 TRUE +#undef STM32_GPT_USE_TIM7 +#define STM32_GPT_USE_TIM7 TRUE +#undef STM32_GPT_USE_TIM8 +#define STM32_GPT_USE_TIM8 TRUE + +// As mentioned above, we need to reallocate the SysTick timer used from +// TIM2 to TIM3. +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 3 diff --git a/keyboards/planck/drop/readme.md b/keyboards/planck/drop/readme.md new file mode 100644 index 000000000000..1034eb9d7a09 --- /dev/null +++ b/keyboards/planck/drop/readme.md @@ -0,0 +1,13 @@ +# Planck + +A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. A complete hardware rework of the Planck, sporting a faster and more powerful STM32 ARM Cortex-M4 microcontroller, with support for rotary encoders and three additional layouts. [More info on qmk.fm](http://qmk.fm/planck/) + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev6 +Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) + +Make example for this keyboard (after setting up your build environment): + + make planck/rev6:default + +See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/drop/rules.mk b/keyboards/planck/drop/rules.mk new file mode 100644 index 000000000000..3c62a7ae10e9 --- /dev/null +++ b/keyboards/planck/drop/rules.mk @@ -0,0 +1,34 @@ +# MCU name +MCU = STM32F303 + +# Bootloader selection +BOOTLOADER = stm32-dfu + +# Build Options +# change to "no" to disable the options +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = yes # Audio output +UNICODE_ENABLE = no # Unicode +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +WS2812_DRIVER = pwm +CUSTOM_MATRIX = yes + +SRC += matrix.c + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RGB_MATRIX_ENABLE = no +RGB_MATRIX_DRIVER = WS2812 +ENCODER_ENABLE = yes +DIP_SWITCH_ENABLE = yes + +LAYOUTS = ortho_4x12 planck_mit +LAYOUTS_HAS_RGB = no diff --git a/keyboards/planck/planck.h b/keyboards/planck/planck.h index 31e3ec9158ea..e506b387fe12 100644 --- a/keyboards/planck/planck.h +++ b/keyboards/planck/planck.h @@ -1,26 +1,41 @@ -#ifndef PLANCK_H -#define PLANCK_H +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once #include "quantum.h" #if defined(KEYBOARD_planck_ez) - #include "ez.h" +# include "ez.h" #elif defined(KEYBOARD_planck_light) - #include "light.h" +# include "light.h" #elif defined(KEYBOARD_planck_thk) - #include "thk.h" +# include "thk.h" #elif defined(KEYBOARD_planck_rev1) - #include "rev1.h" +# include "rev1.h" #elif defined(KEYBOARD_planck_rev2) - #include "rev2.h" +# include "rev2.h" #elif defined(KEYBOARD_planck_rev3) - #include "rev3.h" +# include "rev3.h" #elif defined(KEYBOARD_planck_rev4) - #include "rev4.h" +# include "rev4.h" #elif defined(KEYBOARD_planck_rev5) - #include "rev5.h" +# include "rev5.h" #elif defined(KEYBOARD_planck_rev6) - #include "rev6.h" -#endif // Planck revisions - -#endif +# include "rev6.h" +#elif defined(KEYBOARD_planck_drop) +# include "drop.h" +#endif // Planck revisions From de0be06c7926d3326cb9a58e1c2bae04da1f7d01 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 17 Sep 2021 20:30:00 -0700 Subject: [PATCH 2/6] [Keyboard] Add Preonic Drop board w/ custom matrix --- keyboards/preonic/drop/chconf.h | 29 +++ keyboards/preonic/drop/config.h | 111 ++++++++++ keyboards/preonic/drop/halconf.h | 22 ++ keyboards/preonic/drop/info.json | 342 +++++++++++++++++++++++++++++++ keyboards/preonic/drop/matrix.c | 155 ++++++++++++++ keyboards/preonic/drop/mcuconf.h | 39 ++++ keyboards/preonic/drop/rev3.c | 61 ++++++ keyboards/preonic/drop/rev3.h | 114 +++++++++++ keyboards/preonic/drop/rules.mk | 35 ++++ 9 files changed, 908 insertions(+) create mode 100644 keyboards/preonic/drop/chconf.h create mode 100644 keyboards/preonic/drop/config.h create mode 100644 keyboards/preonic/drop/halconf.h create mode 100644 keyboards/preonic/drop/info.json create mode 100644 keyboards/preonic/drop/matrix.c create mode 100644 keyboards/preonic/drop/mcuconf.h create mode 100644 keyboards/preonic/drop/rev3.c create mode 100644 keyboards/preonic/drop/rev3.h create mode 100644 keyboards/preonic/drop/rules.mk diff --git a/keyboards/preonic/drop/chconf.h b/keyboards/preonic/drop/chconf.h new file mode 100644 index 000000000000..47dd995f8171 --- /dev/null +++ b/keyboards/preonic/drop/chconf.h @@ -0,0 +1,29 @@ +/* Copyright 2021 QMK Contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* + * This file was auto-generated by: + * `qmk chibios-confmigrate -i keyboards/preonic/rev3/chconf.h -r platforms/chibios/QMK_PROTON_C/configs/chconf.h` + */ + +#pragma once + +#define CH_CFG_ST_RESOLUTION 16 + +#define CH_CFG_ST_FREQUENCY 10000 + +#include_next + diff --git a/keyboards/preonic/drop/config.h b/keyboards/preonic/drop/config.h new file mode 100644 index 000000000000..420e7e541301 --- /dev/null +++ b/keyboards/preonic/drop/config.h @@ -0,0 +1,111 @@ +/* + * Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef REV3_CONFIG_H +#define REV3_CONFIG_H + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0003 +#define PRODUCT_ID 0xA649 + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +#define MATRIX_ROW_PINS { A10, A9, A8, B15, C13, C14, C15, A2, A3, A6 } +#define MATRIX_COL_PINS { B11, B10, B2, B1, A7, B0 } +#define UNUSED_PINS + +#define ENCODERS_PAD_A { B12 } +#define ENCODERS_PAD_B { B13 } + +#define DIP_SWITCH_PINS { B14, A15, A0, B9 } + +#define MUSIC_MAP +#undef AUDIO_VOICES +#undef AUDIO_PIN +#define AUDIO_PIN A5 +#define AUDIO_PIN_ALT A4 +#define AUDIO_PIN_ALT_AS_NEGATIVE + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +// #define DEBOUNCE 6 + +/* 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 + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* + * WS2812 Underglow Matrix options + */ +#define RGB_DI_PIN A1 +#define RGBLED_NUM 9 +#define RGBLIGHT_ANIMATIONS +// RGB Matrix support +#define DRIVER_LED_TOTAL RGBLED_NUM + +#define WS2812_PWM_DRIVER PWMD2 +#define WS2812_PWM_CHANNEL 2 +#define WS2812_PWM_PAL_MODE 1 +#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 +#define WS2812_DMA_CHANNEL 2 + +#endif diff --git a/keyboards/preonic/drop/halconf.h b/keyboards/preonic/drop/halconf.h new file mode 100644 index 000000000000..48b76d2f44e2 --- /dev/null +++ b/keyboards/preonic/drop/halconf.h @@ -0,0 +1,22 @@ +/* Copyright 2020 QMK + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#define HAL_USE_PWM TRUE +#define HAL_USE_GPT TRUE +#define HAL_USE_DAC TRUE + +#include_next diff --git a/keyboards/preonic/drop/info.json b/keyboards/preonic/drop/info.json new file mode 100644 index 000000000000..8b7a65384e0a --- /dev/null +++ b/keyboards/preonic/drop/info.json @@ -0,0 +1,342 @@ +{ + "keyboard_name": "Preonic rev. 3", + "url": "https://olkb.com/preonic", + "maintainer": "jackhumbert", + "layouts": { + "LAYOUT_preonic_1x2uC": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + + {"x": 0, "y": 1}, + {"x": 1, "y": 1}, + {"x": 2, "y": 1}, + {"x": 3, "y": 1}, + {"x": 4, "y": 1}, + {"x": 5, "y": 1}, + {"x": 6, "y": 1}, + {"x": 7, "y": 1}, + {"x": 8, "y": 1}, + {"x": 9, "y": 1}, + {"x": 10, "y": 1}, + {"x": 11, "y": 1}, + + {"x": 0, "y": 2}, + {"x": 1, "y": 2}, + {"x": 2, "y": 2}, + {"x": 3, "y": 2}, + {"x": 4, "y": 2}, + {"x": 5, "y": 2}, + {"x": 6, "y": 2}, + {"x": 7, "y": 2}, + {"x": 8, "y": 2}, + {"x": 9, "y": 2}, + {"x": 10, "y": 2}, + {"x": 11, "y": 2}, + + {"x": 0, "y": 3}, + {"x": 1, "y": 3}, + {"x": 2, "y": 3}, + {"x": 3, "y": 3}, + {"x": 4, "y": 3}, + {"x": 5, "y": 3}, + {"x": 6, "y": 3}, + {"x": 7, "y": 3}, + {"x": 8, "y": 3}, + {"x": 9, "y": 3}, + {"x": 10, "y": 3}, + {"x": 11, "y": 3}, + + {"x": 0, "y": 4}, + {"x": 1, "y": 4}, + {"x": 2, "y": 4}, + {"x": 3, "y": 4}, + {"x": 4, "y": 4}, + {"x": 5, "y": 4, "w": 2}, + {"x": 7, "y": 4}, + {"x": 8, "y": 4}, + {"x": 9, "y": 4}, + {"x": 10, "y": 4}, + {"x": 11, "y": 4} + ] + }, + "LAYOUT_preonic_1x2uR": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + + {"x": 0, "y": 1}, + {"x": 1, "y": 1}, + {"x": 2, "y": 1}, + {"x": 3, "y": 1}, + {"x": 4, "y": 1}, + {"x": 5, "y": 1}, + {"x": 6, "y": 1}, + {"x": 7, "y": 1}, + {"x": 8, "y": 1}, + {"x": 9, "y": 1}, + {"x": 10, "y": 1}, + {"x": 11, "y": 1}, + + {"x": 0, "y": 2}, + {"x": 1, "y": 2}, + {"x": 2, "y": 2}, + {"x": 3, "y": 2}, + {"x": 4, "y": 2}, + {"x": 5, "y": 2}, + {"x": 6, "y": 2}, + {"x": 7, "y": 2}, + {"x": 8, "y": 2}, + {"x": 9, "y": 2}, + {"x": 10, "y": 2}, + {"x": 11, "y": 2}, + + {"x": 0, "y": 3}, + {"x": 1, "y": 3}, + {"x": 2, "y": 3}, + {"x": 3, "y": 3}, + {"x": 4, "y": 3}, + {"x": 5, "y": 3}, + {"x": 6, "y": 3}, + {"x": 7, "y": 3}, + {"x": 8, "y": 3}, + {"x": 9, "y": 3}, + {"x": 10, "y": 3}, + {"x": 11, "y": 3}, + + {"x": 0, "y": 4}, + {"x": 1, "y": 4}, + {"x": 2, "y": 4}, + {"x": 3, "y": 4}, + {"x": 4, "y": 4}, + {"x": 5, "y": 4}, + {"x": 6, "y": 4, "w": 2}, + {"x": 8, "y": 4}, + {"x": 9, "y": 4}, + {"x": 10, "y": 4}, + {"x": 11, "y": 4} + ] + }, + "LAYOUT_preonic_1x2uL": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + + {"x": 0, "y": 1}, + {"x": 1, "y": 1}, + {"x": 2, "y": 1}, + {"x": 3, "y": 1}, + {"x": 4, "y": 1}, + {"x": 5, "y": 1}, + {"x": 6, "y": 1}, + {"x": 7, "y": 1}, + {"x": 8, "y": 1}, + {"x": 9, "y": 1}, + {"x": 10, "y": 1}, + {"x": 11, "y": 1}, + + {"x": 0, "y": 2}, + {"x": 1, "y": 2}, + {"x": 2, "y": 2}, + {"x": 3, "y": 2}, + {"x": 4, "y": 2}, + {"x": 5, "y": 2}, + {"x": 6, "y": 2}, + {"x": 7, "y": 2}, + {"x": 8, "y": 2}, + {"x": 9, "y": 2}, + {"x": 10, "y": 2}, + {"x": 11, "y": 2}, + + {"x": 0, "y": 3}, + {"x": 1, "y": 3}, + {"x": 2, "y": 3}, + {"x": 3, "y": 3}, + {"x": 4, "y": 3}, + {"x": 5, "y": 3}, + {"x": 6, "y": 3}, + {"x": 7, "y": 3}, + {"x": 8, "y": 3}, + {"x": 9, "y": 3}, + {"x": 10, "y": 3}, + {"x": 11, "y": 3}, + + {"x": 0, "y": 4}, + {"x": 1, "y": 4}, + {"x": 2, "y": 4}, + {"x": 3, "y": 4}, + {"x": 4, "y": 4, "w": 2}, + {"x": 6, "y": 4}, + {"x": 7, "y": 4}, + {"x": 8, "y": 4}, + {"x": 9, "y": 4}, + {"x": 10, "y": 4}, + {"x": 11, "y": 4} + ] + }, + "LAYOUT_preonic_2x2u": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + + {"x": 0, "y": 1}, + {"x": 1, "y": 1}, + {"x": 2, "y": 1}, + {"x": 3, "y": 1}, + {"x": 4, "y": 1}, + {"x": 5, "y": 1}, + {"x": 6, "y": 1}, + {"x": 7, "y": 1}, + {"x": 8, "y": 1}, + {"x": 9, "y": 1}, + {"x": 10, "y": 1}, + {"x": 11, "y": 1}, + + {"x": 0, "y": 2}, + {"x": 1, "y": 2}, + {"x": 2, "y": 2}, + {"x": 3, "y": 2}, + {"x": 4, "y": 2}, + {"x": 5, "y": 2}, + {"x": 6, "y": 2}, + {"x": 7, "y": 2}, + {"x": 8, "y": 2}, + {"x": 9, "y": 2}, + {"x": 10, "y": 2}, + {"x": 11, "y": 2}, + + {"x": 0, "y": 3}, + {"x": 1, "y": 3}, + {"x": 2, "y": 3}, + {"x": 3, "y": 3}, + {"x": 4, "y": 3}, + {"x": 5, "y": 3}, + {"x": 6, "y": 3}, + {"x": 7, "y": 3}, + {"x": 8, "y": 3}, + {"x": 9, "y": 3}, + {"x": 10, "y": 3}, + {"x": 11, "y": 3}, + + {"x": 0, "y": 4}, + {"x": 1, "y": 4}, + {"x": 2, "y": 4}, + {"x": 3, "y": 4}, + {"x": 4, "y": 4, "w": 2}, + {"x": 6, "y": 4, "w": 2}, + {"x": 8, "y": 4}, + {"x": 9, "y": 4}, + {"x": 10, "y": 4}, + {"x": 11, "y": 4} + ] + }, + "LAYOUT_ortho_5x12": { + "layout": [ + {"x": 0, "y": 0}, + {"x": 1, "y": 0}, + {"x": 2, "y": 0}, + {"x": 3, "y": 0}, + {"x": 4, "y": 0}, + {"x": 5, "y": 0}, + {"x": 6, "y": 0}, + {"x": 7, "y": 0}, + {"x": 8, "y": 0}, + {"x": 9, "y": 0}, + {"x": 10, "y": 0}, + {"x": 11, "y": 0}, + + {"x": 0, "y": 1}, + {"x": 1, "y": 1}, + {"x": 2, "y": 1}, + {"x": 3, "y": 1}, + {"x": 4, "y": 1}, + {"x": 5, "y": 1}, + {"x": 6, "y": 1}, + {"x": 7, "y": 1}, + {"x": 8, "y": 1}, + {"x": 9, "y": 1}, + {"x": 10, "y": 1}, + {"x": 11, "y": 1}, + + {"x": 0, "y": 2}, + {"x": 1, "y": 2}, + {"x": 2, "y": 2}, + {"x": 3, "y": 2}, + {"x": 4, "y": 2}, + {"x": 5, "y": 2}, + {"x": 6, "y": 2}, + {"x": 7, "y": 2}, + {"x": 8, "y": 2}, + {"x": 9, "y": 2}, + {"x": 10, "y": 2}, + {"x": 11, "y": 2}, + + {"x": 0, "y": 3}, + {"x": 1, "y": 3}, + {"x": 2, "y": 3}, + {"x": 3, "y": 3}, + {"x": 4, "y": 3}, + {"x": 5, "y": 3}, + {"x": 6, "y": 3}, + {"x": 7, "y": 3}, + {"x": 8, "y": 3}, + {"x": 9, "y": 3}, + {"x": 10, "y": 3}, + {"x": 11, "y": 3}, + + {"x": 0, "y": 4}, + {"x": 1, "y": 4}, + {"x": 2, "y": 4}, + {"x": 3, "y": 4}, + {"x": 4, "y": 4}, + {"x": 5, "y": 4}, + {"x": 6, "y": 4}, + {"x": 7, "y": 4}, + {"x": 8, "y": 4}, + {"x": 9, "y": 4}, + {"x": 10, "y": 4}, + {"x": 11, "y": 4} + ] + } + } +} diff --git a/keyboards/preonic/drop/matrix.c b/keyboards/preonic/drop/matrix.c new file mode 100644 index 000000000000..9f355a42f198 --- /dev/null +++ b/keyboards/preonic/drop/matrix.c @@ -0,0 +1,155 @@ +#include +#include +#include +#include "hal.h" +#include "timer.h" +#include "wait.h" +#include "printf.h" +#include "backlight.h" +#include "matrix.h" +#include "action.h" +#include "keycode.h" +#include + +/* + * col: { B11, B10, B2, B1, A7, B0 } + * row: { A10, A9, A8, B15, C13, C14, C15, A2 } + */ +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_col_t matrix_debouncing[MATRIX_COLS]; +static bool debouncing = false; +static uint16_t debouncing_time = 0; + +__attribute__((weak)) void matrix_init_user(void) {} + +__attribute__((weak)) void matrix_scan_user(void) {} + +__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); } + +__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); } + +void matrix_init(void) { + printf("matrix init\n"); + // debug_matrix = true; + + // actual matrix setup + palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); + + palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 9, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 8, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOB, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 13, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 14, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 2, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 3, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN); + + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_col_t)); + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + // actual matrix + for (int col = 0; col < MATRIX_COLS; col++) { + matrix_col_t data = 0; + + // strobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: + palSetPad(GPIOB, 11); + break; + case 1: + palSetPad(GPIOB, 10); + break; + case 2: + palSetPad(GPIOB, 2); + break; + case 3: + palSetPad(GPIOB, 1); + break; + case 4: + palSetPad(GPIOA, 7); + break; + case 5: + palSetPad(GPIOB, 0); + break; + } + + // need wait to settle pin state + wait_us(20); + + // read row data { A10, A9, A8, B15, C13, C14, C15, A2 } + data = ((palReadPad(GPIOA, 10) << 0) | (palReadPad(GPIOA, 9) << 1) | (palReadPad(GPIOA, 8) << 2) | (palReadPad(GPIOB, 15) << 3) | (palReadPad(GPIOC, 13) << 4) | (palReadPad(GPIOC, 14) << 5) | (palReadPad(GPIOC, 15) << 6) | (palReadPad(GPIOA, 2) << 7) | (palReadPad(GPIOA, 3) << 8) | (palReadPad(GPIOA, 6) << 9)); + + // unstrobe col { B11, B10, B2, B1, A7, B0 } + switch (col) { + case 0: + palClearPad(GPIOB, 11); + break; + case 1: + palClearPad(GPIOB, 10); + break; + case 2: + palClearPad(GPIOB, 2); + break; + case 3: + palClearPad(GPIOB, 1); + break; + case 4: + palClearPad(GPIOA, 7); + break; + case 5: + palClearPad(GPIOB, 0); + break; + } + + if (matrix_debouncing[col] != data) { + matrix_debouncing[col] = data; + debouncing = true; + debouncing_time = timer_read(); + } + } + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int row = 0; row < MATRIX_ROWS; row++) { + matrix[row] = 0; + for (int col = 0; col < MATRIX_COLS; col++) { + matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col); + } + } + debouncing = false; + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_on(uint8_t row, uint8_t col) { return (matrix[row] & (1 << col)); } + +matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; } + +void matrix_print(void) { + printf("\nr/c 01234567\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + printf("%X0: ", row); + matrix_row_t data = matrix_get_row(row); + for (int col = 0; col < MATRIX_COLS; col++) { + if (data & (1 << col)) + printf("1"); + else + printf("0"); + } + printf("\n"); + } +} diff --git a/keyboards/preonic/drop/mcuconf.h b/keyboards/preonic/drop/mcuconf.h new file mode 100644 index 000000000000..31abf13b631d --- /dev/null +++ b/keyboards/preonic/drop/mcuconf.h @@ -0,0 +1,39 @@ +/* Copyright 2020 QMK Contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include_next "mcuconf.h" + +// The SysTick timer from the normal quantum/stm32 uses TIM2 -- the WS2812 pin used +// on the Planck requires the use of TIM2 to run PWM -- rework which timers are +// allocated for PWM usage. +#undef STM32_PWM_USE_TIM2 +#define STM32_PWM_USE_TIM2 TRUE + +#undef STM32_DAC_USE_DAC1_CH1 +#define STM32_DAC_USE_DAC1_CH1 TRUE +#undef STM32_DAC_USE_DAC1_CH2 +#define STM32_DAC_USE_DAC1_CH2 TRUE +#undef STM32_GPT_USE_TIM6 +#define STM32_GPT_USE_TIM6 TRUE +#undef STM32_GPT_USE_TIM7 +#define STM32_GPT_USE_TIM7 TRUE +#undef STM32_GPT_USE_TIM8 +#define STM32_GPT_USE_TIM8 TRUE + +// As mentioned above, we need to reallocate the SysTick timer used from +// TIM2 to TIM3. +#undef STM32_ST_USE_TIMER +#define STM32_ST_USE_TIMER 3 diff --git a/keyboards/preonic/drop/rev3.c b/keyboards/preonic/drop/rev3.c new file mode 100644 index 000000000000..7ccff70611bb --- /dev/null +++ b/keyboards/preonic/drop/rev3.c @@ -0,0 +1,61 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include "rev3.h" + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { { + // Key Matrix to LED Index + { NO_LED, 6, NO_LED, NO_LED, 5, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, 0 }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 4, NO_LED, NO_LED, 3, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, NO_LED, NO_LED, NO_LED, NO_LED, NO_LED }, + { NO_LED, 7, NO_LED, NO_LED, 2, NO_LED }, + { NO_LED, 1, NO_LED, NO_LED, 8, NO_LED }, +}, { + // LED Index to Physical Position + {112, 39}, {148, 60}, {206, 53}, {206, 3}, {150, 3}, {74, 3}, {18, 3}, {18, 54}, {77, 60} +}, { + // LED Index to Flag + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, + LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL, LED_FLAG_ALL +} }; + +// LED physical location index +// 6 5 4 3 +// 0 +// 7 8 1 2 +#endif + + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, + {{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, + {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + {{5, 8}, {4, 8}, {3, 8}, {2, 8}, {1, 8}, {0, 8}}, + {{5, 9}, {4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}}, +}; +#endif diff --git a/keyboards/preonic/drop/rev3.h b/keyboards/preonic/drop/rev3.h new file mode 100644 index 000000000000..e6462d5b751f --- /dev/null +++ b/keyboards/preonic/drop/rev3.h @@ -0,0 +1,114 @@ +/* Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include "preonic.h" + +#define LAYOUT_preonic_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ +) { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k45, k47, k48, k43, k44, k45 } \ +} + +#define LAYOUT_preonic_1x2uR( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k47, k47, k48, k43, k44, k45 } \ +} + +#define LAYOUT_preonic_1x2uL( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k46, k47, k48, k49, k4a, k4b \ +) { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k44 } \ +} + +#define LAYOUT_preonic_2x2u( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \ +) { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k46, k48, k43, k44, k44 } \ +} + +#define LAYOUT_ortho_5x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ +) { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k45 } \ +} diff --git a/keyboards/preonic/drop/rules.mk b/keyboards/preonic/drop/rules.mk new file mode 100644 index 000000000000..24ae4ae54e28 --- /dev/null +++ b/keyboards/preonic/drop/rules.mk @@ -0,0 +1,35 @@ +# MCU name +MCU = STM32F303 + +# Bootloader selection +BOOTLOADER = stm32-dfu + +# Build Options +# change to "no" to disable the options +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +AUDIO_ENABLE = yes # Audio output +UNICODE_ENABLE = no # Unicode +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +WS2812_DRIVER = pwm +CUSTOM_MATRIX = yes + +SRC += matrix.c + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Do not enable RGB_MATRIX_ENABLE together with RGBLIGHT_ENABLE +RGB_MATRIX_ENABLE = no +RGB_MATRIX_DRIVER = WS2812 + +ENCODER_ENABLE = yes +DIP_SWITCH_ENABLE = yes + +LAYOUTS = ortho_5x12 From 9cdba66b4db45aa8607beef0431c6c284f31b5a9 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 17 Sep 2021 20:32:11 -0700 Subject: [PATCH 3/6] Fixup includes --- keyboards/planck/drop/matrix.c | 4 +--- keyboards/preonic/drop/matrix.c | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/keyboards/planck/drop/matrix.c b/keyboards/planck/drop/matrix.c index 82631f4d3f69..fc85f0806980 100644 --- a/keyboards/planck/drop/matrix.c +++ b/keyboards/planck/drop/matrix.c @@ -4,10 +4,8 @@ #include "hal.h" #include "timer.h" #include "wait.h" -#include "printf.h" +#include "debug.h" #include "matrix.h" -#include "action.h" -#include "keycode.h" /* * col: { B11, B10, B2, B1, A7, B0 } diff --git a/keyboards/preonic/drop/matrix.c b/keyboards/preonic/drop/matrix.c index 9f355a42f198..c8897ac5542a 100644 --- a/keyboards/preonic/drop/matrix.c +++ b/keyboards/preonic/drop/matrix.c @@ -4,12 +4,8 @@ #include "hal.h" #include "timer.h" #include "wait.h" -#include "printf.h" -#include "backlight.h" +#include "debug.h" #include "matrix.h" -#include "action.h" -#include "keycode.h" -#include /* * col: { B11, B10, B2, B1, A7, B0 } From 7b428a3e9e68314aee35b6e53a1e4e8faf558731 Mon Sep 17 00:00:00 2001 From: Drashna Jael're Date: Fri, 17 Sep 2021 21:35:14 -0700 Subject: [PATCH 4/6] Additional fixes --- keyboards/planck/drop/config.h | 2 +- keyboards/planck/drop/matrix.c | 17 +++++++++++ keyboards/preonic/drop/config.h | 7 ++--- keyboards/preonic/drop/{rev3.c => drop.c} | 2 +- keyboards/preonic/drop/{rev3.h => drop.h} | 1 + keyboards/preonic/drop/matrix.c | 23 +++++++++++++-- keyboards/preonic/preonic.h | 35 ++++++++++++++++------- 7 files changed, 68 insertions(+), 19 deletions(-) rename keyboards/preonic/drop/{rev3.c => drop.c} (99%) rename keyboards/preonic/drop/{rev3.h => drop.h} (99%) diff --git a/keyboards/planck/drop/config.h b/keyboards/planck/drop/config.h index 022ab64608ef..c1baa34b721e 100644 --- a/keyboards/planck/drop/config.h +++ b/keyboards/planck/drop/config.h @@ -21,7 +21,7 @@ #define PRODUCT_ID 0xA4F9 #define DEVICE_VER 0x0006 #undef MANUFACTURER -#define MANUFACTURER OLKB +#define MANUFACTURER Drop #undef MATRIX_ROWS #undef MATRIX_COLS diff --git a/keyboards/planck/drop/matrix.c b/keyboards/planck/drop/matrix.c index fc85f0806980..1fb6ba0d4229 100644 --- a/keyboards/planck/drop/matrix.c +++ b/keyboards/planck/drop/matrix.c @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include diff --git a/keyboards/preonic/drop/config.h b/keyboards/preonic/drop/config.h index 420e7e541301..1a0605e73903 100644 --- a/keyboards/preonic/drop/config.h +++ b/keyboards/preonic/drop/config.h @@ -15,12 +15,13 @@ * along with this program. If not, see . */ -#ifndef REV3_CONFIG_H -#define REV3_CONFIG_H +#pragma once /* USB Device descriptor parameter */ #define DEVICE_VER 0x0003 #define PRODUCT_ID 0xA649 +#undef MANUFACTURER +#define MANUFACTURER Drop #undef MATRIX_ROWS #undef MATRIX_COLS @@ -107,5 +108,3 @@ #define WS2812_PWM_PAL_MODE 1 #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 #define WS2812_DMA_CHANNEL 2 - -#endif diff --git a/keyboards/preonic/drop/rev3.c b/keyboards/preonic/drop/drop.c similarity index 99% rename from keyboards/preonic/drop/rev3.c rename to keyboards/preonic/drop/drop.c index 7ccff70611bb..a0319860e5c6 100644 --- a/keyboards/preonic/drop/rev3.c +++ b/keyboards/preonic/drop/drop.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "rev3.h" +#include "drop.h" #ifdef RGB_MATRIX_ENABLE led_config_t g_led_config = { { diff --git a/keyboards/preonic/drop/rev3.h b/keyboards/preonic/drop/drop.h similarity index 99% rename from keyboards/preonic/drop/rev3.h rename to keyboards/preonic/drop/drop.h index e6462d5b751f..3cb9368757ee 100644 --- a/keyboards/preonic/drop/rev3.h +++ b/keyboards/preonic/drop/drop.h @@ -18,6 +18,7 @@ #include "preonic.h" +// clang-format off #define LAYOUT_preonic_1x2uC( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ diff --git a/keyboards/preonic/drop/matrix.c b/keyboards/preonic/drop/matrix.c index c8897ac5542a..b094d28cdca4 100644 --- a/keyboards/preonic/drop/matrix.c +++ b/keyboards/preonic/drop/matrix.c @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include #include #include @@ -13,7 +30,7 @@ */ /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_col_t matrix_debouncing[MATRIX_COLS]; +static matrix_row_t matrix_debouncing[MATRIX_COLS]; static bool debouncing = false; static uint16_t debouncing_time = 0; @@ -49,7 +66,7 @@ void matrix_init(void) { palSetPadMode(GPIOA, 6, PAL_MODE_INPUT_PULLDOWN); memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_col_t)); + memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t)); matrix_init_quantum(); } @@ -57,7 +74,7 @@ void matrix_init(void) { uint8_t matrix_scan(void) { // actual matrix for (int col = 0; col < MATRIX_COLS; col++) { - matrix_col_t data = 0; + matrix_row_t data = 0; // strobe col { B11, B10, B2, B1, A7, B0 } switch (col) { diff --git a/keyboards/preonic/preonic.h b/keyboards/preonic/preonic.h index 4f8ebcc3ee51..71992307691d 100644 --- a/keyboards/preonic/preonic.h +++ b/keyboards/preonic/preonic.h @@ -1,3 +1,20 @@ +/* + * Copyright 2018 Jack Humbert + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #pragma once #include "quantum.h" @@ -5,16 +22,14 @@ /************************************************** ** Include headers specific to keyboard revision ** **************************************************/ -#ifdef KEYBOARD_preonic_rev1 - #include "rev1.h" -#endif - -#ifdef KEYBOARD_preonic_rev2 - #include "rev2.h" -#endif - -#ifdef KEYBOARD_preonic_rev3 - #include "rev3.h" +#if defined(KEYBOARD_preonic_rev1) +# include "rev1.h" +#elif defined(KEYBOARD_preonic_rev2) +# include "rev2.h" +#elif defined(KEYBOARD_preonic_rev3) +# include "rev3.h" +#elif defined(KEYBOARD_preonic_drop) +# include "drop.h" #endif From 92a49bd7a3ed7468e7b8b22bd674ad00c6c4e783 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 17 Sep 2021 23:47:24 -0700 Subject: [PATCH 5/6] Apply suggestions from code review Co-authored-by: Ryan --- keyboards/planck/drop/readme.md | 6 +++--- keyboards/planck/drop/rules.mk | 33 ++++++++++++++++---------------- keyboards/preonic/drop/rules.mk | 34 ++++++++++++++++----------------- 3 files changed, 35 insertions(+), 38 deletions(-) diff --git a/keyboards/planck/drop/readme.md b/keyboards/planck/drop/readme.md index 1034eb9d7a09..1269d8a64701 100644 --- a/keyboards/planck/drop/readme.md +++ b/keyboards/planck/drop/readme.md @@ -2,9 +2,9 @@ A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. A complete hardware rework of the Planck, sporting a faster and more powerful STM32 ARM Cortex-M4 microcontroller, with support for rotary encoders and three additional layouts. [More info on qmk.fm](http://qmk.fm/planck/) -Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) -Hardware Supported: Planck PCB rev6 -Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) +* Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +* Hardware Supported: Planck PCB rev6 +* Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/planck/drop/rules.mk b/keyboards/planck/drop/rules.mk index 3c62a7ae10e9..c35de3d74b47 100644 --- a/keyboards/planck/drop/rules.mk +++ b/keyboards/planck/drop/rules.mk @@ -5,30 +5,29 @@ MCU = STM32F303 BOOTLOADER = stm32-dfu # Build Options -# change to "no" to disable the options +# change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = yes # Audio output -UNICODE_ENABLE = no # Unicode -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # 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 = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = yes # Audio output WS2812_DRIVER = pwm CUSTOM_MATRIX = yes - -SRC += matrix.c - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - +# Do not enable RGB_MATRIX_ENABLE together with RGBLIGHT_ENABLE RGB_MATRIX_ENABLE = no RGB_MATRIX_DRIVER = WS2812 ENCODER_ENABLE = yes DIP_SWITCH_ENABLE = yes +SRC += matrix.c + LAYOUTS = ortho_4x12 planck_mit LAYOUTS_HAS_RGB = no diff --git a/keyboards/preonic/drop/rules.mk b/keyboards/preonic/drop/rules.mk index 24ae4ae54e28..8ab62afe212f 100644 --- a/keyboards/preonic/drop/rules.mk +++ b/keyboards/preonic/drop/rules.mk @@ -5,31 +5,29 @@ MCU = STM32F303 BOOTLOADER = stm32-dfu # Build Options -# change to "no" to disable the options +# change yes to no to disable # -BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite -MOUSEKEY_ENABLE = yes # Mouse keys -EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = yes # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -AUDIO_ENABLE = yes # Audio output -UNICODE_ENABLE = no # Unicode -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # 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 = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = yes # Audio output WS2812_DRIVER = pwm CUSTOM_MATRIX = yes - -SRC += matrix.c - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +ENCODER_ENABLE = yes +DIP_SWITCH_ENABLE = yes # Do not enable RGB_MATRIX_ENABLE together with RGBLIGHT_ENABLE RGB_MATRIX_ENABLE = no RGB_MATRIX_DRIVER = WS2812 -ENCODER_ENABLE = yes -DIP_SWITCH_ENABLE = yes +SRC += matrix.c LAYOUTS = ortho_5x12 From 96b666e49ec6e68da15c08acd1f11031f73adc01 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 18 Sep 2021 19:52:43 -0400 Subject: [PATCH 6/6] rename with rev in name --- keyboards/planck/planck.h | 4 ++-- keyboards/planck/{drop => rev6_drop}/chconf.h | 0 keyboards/planck/{drop => rev6_drop}/config.h | 0 keyboards/planck/{drop => rev6_drop}/halconf.h | 0 keyboards/planck/{drop => rev6_drop}/info.json | 0 keyboards/planck/{drop => rev6_drop}/matrix.c | 0 keyboards/planck/{drop => rev6_drop}/mcuconf.h | 0 keyboards/planck/{drop => rev6_drop}/readme.md | 2 +- keyboards/planck/{drop/drop.c => rev6_drop/rev6_drop.c} | 2 +- keyboards/planck/{drop/drop.h => rev6_drop/rev6_drop.h} | 0 keyboards/planck/{drop => rev6_drop}/rules.mk | 0 keyboards/preonic/preonic.h | 4 ++-- keyboards/preonic/{drop => rev3_drop}/chconf.h | 0 keyboards/preonic/{drop => rev3_drop}/config.h | 0 keyboards/preonic/{drop => rev3_drop}/halconf.h | 0 keyboards/preonic/{drop => rev3_drop}/info.json | 0 keyboards/preonic/{drop => rev3_drop}/matrix.c | 0 keyboards/preonic/{drop => rev3_drop}/mcuconf.h | 0 keyboards/preonic/{drop/drop.c => rev3_drop/rev3_drop.c} | 2 +- keyboards/preonic/{drop/drop.h => rev3_drop/rev3_drop.h} | 0 keyboards/preonic/{drop => rev3_drop}/rules.mk | 0 21 files changed, 7 insertions(+), 7 deletions(-) rename keyboards/planck/{drop => rev6_drop}/chconf.h (100%) rename keyboards/planck/{drop => rev6_drop}/config.h (100%) rename keyboards/planck/{drop => rev6_drop}/halconf.h (100%) rename keyboards/planck/{drop => rev6_drop}/info.json (100%) rename keyboards/planck/{drop => rev6_drop}/matrix.c (100%) rename keyboards/planck/{drop => rev6_drop}/mcuconf.h (100%) rename keyboards/planck/{drop => rev6_drop}/readme.md (96%) rename keyboards/planck/{drop/drop.c => rev6_drop/rev6_drop.c} (98%) rename keyboards/planck/{drop/drop.h => rev6_drop/rev6_drop.h} (100%) rename keyboards/planck/{drop => rev6_drop}/rules.mk (100%) rename keyboards/preonic/{drop => rev3_drop}/chconf.h (100%) rename keyboards/preonic/{drop => rev3_drop}/config.h (100%) rename keyboards/preonic/{drop => rev3_drop}/halconf.h (100%) rename keyboards/preonic/{drop => rev3_drop}/info.json (100%) rename keyboards/preonic/{drop => rev3_drop}/matrix.c (100%) rename keyboards/preonic/{drop => rev3_drop}/mcuconf.h (100%) rename keyboards/preonic/{drop/drop.c => rev3_drop/rev3_drop.c} (99%) rename keyboards/preonic/{drop/drop.h => rev3_drop/rev3_drop.h} (100%) rename keyboards/preonic/{drop => rev3_drop}/rules.mk (100%) diff --git a/keyboards/planck/planck.h b/keyboards/planck/planck.h index e506b387fe12..4b04dfec5149 100644 --- a/keyboards/planck/planck.h +++ b/keyboards/planck/planck.h @@ -36,6 +36,6 @@ # include "rev5.h" #elif defined(KEYBOARD_planck_rev6) # include "rev6.h" -#elif defined(KEYBOARD_planck_drop) -# include "drop.h" +#elif defined(KEYBOARD_planck_rev6_drop) +# include "rev6_drop.h" #endif // Planck revisions diff --git a/keyboards/planck/drop/chconf.h b/keyboards/planck/rev6_drop/chconf.h similarity index 100% rename from keyboards/planck/drop/chconf.h rename to keyboards/planck/rev6_drop/chconf.h diff --git a/keyboards/planck/drop/config.h b/keyboards/planck/rev6_drop/config.h similarity index 100% rename from keyboards/planck/drop/config.h rename to keyboards/planck/rev6_drop/config.h diff --git a/keyboards/planck/drop/halconf.h b/keyboards/planck/rev6_drop/halconf.h similarity index 100% rename from keyboards/planck/drop/halconf.h rename to keyboards/planck/rev6_drop/halconf.h diff --git a/keyboards/planck/drop/info.json b/keyboards/planck/rev6_drop/info.json similarity index 100% rename from keyboards/planck/drop/info.json rename to keyboards/planck/rev6_drop/info.json diff --git a/keyboards/planck/drop/matrix.c b/keyboards/planck/rev6_drop/matrix.c similarity index 100% rename from keyboards/planck/drop/matrix.c rename to keyboards/planck/rev6_drop/matrix.c diff --git a/keyboards/planck/drop/mcuconf.h b/keyboards/planck/rev6_drop/mcuconf.h similarity index 100% rename from keyboards/planck/drop/mcuconf.h rename to keyboards/planck/rev6_drop/mcuconf.h diff --git a/keyboards/planck/drop/readme.md b/keyboards/planck/rev6_drop/readme.md similarity index 96% rename from keyboards/planck/drop/readme.md rename to keyboards/planck/rev6_drop/readme.md index 1269d8a64701..0ea2619acb12 100644 --- a/keyboards/planck/drop/readme.md +++ b/keyboards/planck/rev6_drop/readme.md @@ -8,6 +8,6 @@ A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop Make example for this keyboard (after setting up your build environment): - make planck/rev6:default + make planck/rev6_drop:default See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). diff --git a/keyboards/planck/drop/drop.c b/keyboards/planck/rev6_drop/rev6_drop.c similarity index 98% rename from keyboards/planck/drop/drop.c rename to keyboards/planck/rev6_drop/rev6_drop.c index 76a6cb84b78a..4c41af3806fd 100644 --- a/keyboards/planck/drop/drop.c +++ b/keyboards/planck/rev6_drop/rev6_drop.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "drop.h" +#include "rev6_drop.h" #ifdef RGB_MATRIX_ENABLE // clang-format off diff --git a/keyboards/planck/drop/drop.h b/keyboards/planck/rev6_drop/rev6_drop.h similarity index 100% rename from keyboards/planck/drop/drop.h rename to keyboards/planck/rev6_drop/rev6_drop.h diff --git a/keyboards/planck/drop/rules.mk b/keyboards/planck/rev6_drop/rules.mk similarity index 100% rename from keyboards/planck/drop/rules.mk rename to keyboards/planck/rev6_drop/rules.mk diff --git a/keyboards/preonic/preonic.h b/keyboards/preonic/preonic.h index 71992307691d..6b10a425abbb 100644 --- a/keyboards/preonic/preonic.h +++ b/keyboards/preonic/preonic.h @@ -28,8 +28,8 @@ # include "rev2.h" #elif defined(KEYBOARD_preonic_rev3) # include "rev3.h" -#elif defined(KEYBOARD_preonic_drop) -# include "drop.h" +#elif defined(KEYBOARD_preonic_rev3_drop) +# include "rev3_drop.h" #endif diff --git a/keyboards/preonic/drop/chconf.h b/keyboards/preonic/rev3_drop/chconf.h similarity index 100% rename from keyboards/preonic/drop/chconf.h rename to keyboards/preonic/rev3_drop/chconf.h diff --git a/keyboards/preonic/drop/config.h b/keyboards/preonic/rev3_drop/config.h similarity index 100% rename from keyboards/preonic/drop/config.h rename to keyboards/preonic/rev3_drop/config.h diff --git a/keyboards/preonic/drop/halconf.h b/keyboards/preonic/rev3_drop/halconf.h similarity index 100% rename from keyboards/preonic/drop/halconf.h rename to keyboards/preonic/rev3_drop/halconf.h diff --git a/keyboards/preonic/drop/info.json b/keyboards/preonic/rev3_drop/info.json similarity index 100% rename from keyboards/preonic/drop/info.json rename to keyboards/preonic/rev3_drop/info.json diff --git a/keyboards/preonic/drop/matrix.c b/keyboards/preonic/rev3_drop/matrix.c similarity index 100% rename from keyboards/preonic/drop/matrix.c rename to keyboards/preonic/rev3_drop/matrix.c diff --git a/keyboards/preonic/drop/mcuconf.h b/keyboards/preonic/rev3_drop/mcuconf.h similarity index 100% rename from keyboards/preonic/drop/mcuconf.h rename to keyboards/preonic/rev3_drop/mcuconf.h diff --git a/keyboards/preonic/drop/drop.c b/keyboards/preonic/rev3_drop/rev3_drop.c similarity index 99% rename from keyboards/preonic/drop/drop.c rename to keyboards/preonic/rev3_drop/rev3_drop.c index a0319860e5c6..0b3f452c4423 100644 --- a/keyboards/preonic/drop/drop.c +++ b/keyboards/preonic/rev3_drop/rev3_drop.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "drop.h" +#include "rev3_drop.h" #ifdef RGB_MATRIX_ENABLE led_config_t g_led_config = { { diff --git a/keyboards/preonic/drop/drop.h b/keyboards/preonic/rev3_drop/rev3_drop.h similarity index 100% rename from keyboards/preonic/drop/drop.h rename to keyboards/preonic/rev3_drop/rev3_drop.h diff --git a/keyboards/preonic/drop/rules.mk b/keyboards/preonic/rev3_drop/rules.mk similarity index 100% rename from keyboards/preonic/drop/rules.mk rename to keyboards/preonic/rev3_drop/rules.mk