From 207f0b00fa14c853b0015c30b7c5482a19afc25a Mon Sep 17 00:00:00 2001 From: Spaceman Date: Tue, 22 Sep 2020 03:33:39 -0400 Subject: [PATCH] [Keyboard] add Handwired/Curiosity (#10369) * Add curiosity * Add default keymap * Update config.h * Apply suggestions from code review * Update keyboards/handwired/curiosity/rules.mk * Update keymap.c * Apply suggestions from code review --- keyboards/handwired/curiosity/config.h | 44 +++++++++++++++++++ keyboards/handwired/curiosity/curiosity.c | 16 +++++++ keyboards/handwired/curiosity/curiosity.h | 41 +++++++++++++++++ keyboards/handwired/curiosity/info.json | 25 +++++++++++ .../curiosity/keymaps/default/keymap.c | 33 ++++++++++++++ keyboards/handwired/curiosity/readme.md | 13 ++++++ keyboards/handwired/curiosity/rules.mk | 23 ++++++++++ 7 files changed, 195 insertions(+) create mode 100644 keyboards/handwired/curiosity/config.h create mode 100644 keyboards/handwired/curiosity/curiosity.c create mode 100644 keyboards/handwired/curiosity/curiosity.h create mode 100644 keyboards/handwired/curiosity/info.json create mode 100644 keyboards/handwired/curiosity/keymaps/default/keymap.c create mode 100644 keyboards/handwired/curiosity/readme.md create mode 100644 keyboards/handwired/curiosity/rules.mk diff --git a/keyboards/handwired/curiosity/config.h b/keyboards/handwired/curiosity/config.h new file mode 100644 index 0000000000..8b632a5ec4 --- /dev/null +++ b/keyboards/handwired/curiosity/config.h @@ -0,0 +1,44 @@ +/* +Copyright 2020 Spaceman + +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 "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5342 // "SB" +#define PRODUCT_ID 0x4355 // "CU" +#define DEVICE_VER 0x0001 +#define MANUFACTURER Spaceman +#define PRODUCT Curiosity + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, F7, F6, F5 } +#define MATRIX_COL_PINS { D3, D4, F4, C6, D7, E6, B5, B4, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#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/handwired/curiosity/curiosity.c b/keyboards/handwired/curiosity/curiosity.c new file mode 100644 index 0000000000..e0a6e130e7 --- /dev/null +++ b/keyboards/handwired/curiosity/curiosity.c @@ -0,0 +1,16 @@ +/* Copyright 2020 Spaceman + * + * 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 "curiosity.h" \ No newline at end of file diff --git a/keyboards/handwired/curiosity/curiosity.h b/keyboards/handwired/curiosity/curiosity.h new file mode 100644 index 0000000000..a79bfa6633 --- /dev/null +++ b/keyboards/handwired/curiosity/curiosity.h @@ -0,0 +1,41 @@ +/* Copyright 2020 Spaceman + * + * 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" + +#define LAYOUT_small_mods( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k3b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k3a, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k39, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38 \ +) { \ + { 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 }, \ +} +#define LAYOUT_large_mods( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k3b, \ + 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 \ +) { \ + { 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, KC_NO, KC_NO, k3b }, \ +} diff --git a/keyboards/handwired/curiosity/info.json b/keyboards/handwired/curiosity/info.json new file mode 100644 index 0000000000..333868e1a7 --- /dev/null +++ b/keyboards/handwired/curiosity/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "Curiosity", + "url": "", + "maintainer": "Spaceman", + "width": 13.5, + "height": 4, + "layouts": { + "LAYOUT_small_mods": { + "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":12, "y":0, "w":1.5}, + {"x":0, "y":1, "w":1.25}, {"x":1.25, "y":1}, {"x":2.25, "y":1}, {"x":3.25, "y":1}, {"x":4.25, "y":1}, {"x":5.25, "y":1}, {"x":6.25, "y":1}, {"x":7.25, "y":1}, {"x":8.25, "y":1}, {"x":9.25, "y":1}, {"x":10.25, "y":1}, {"x":11.25, "y":1}, {"x":12.25, "y":1, "w":1.25}, + {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, + {"x":0.75, "y":3, "w":1.25}, {"x":2, "y":3, "w":1.25}, {"x":3.25, "y":3, "w":1.25}, {"x":4.5, "y":3, "w":2}, {"x":6.5, "y":3, "w":2.25}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3} + ] + }, + "LAYOUT_large_mods": { + "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":12, "y":0, "w":1.5}, + {"x":0, "y":1, "w":1.25}, {"x":1.25, "y":1}, {"x":2.25, "y":1}, {"x":3.25, "y":1}, {"x":4.25, "y":1}, {"x":5.25, "y":1}, {"x":6.25, "y":1}, {"x":7.25, "y":1}, {"x":8.25, "y":1}, {"x":9.25, "y":1}, {"x":10.25, "y":1}, {"x":11.25, "y":1, "w":2.25}, + {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2, "w":2}, + {"x":0.75, "y":3, "w":1.25}, {"x":2, "y":3, "w":1.25}, {"x":3.25, "y":3, "w":1.25}, {"x":4.5, "y":3, "w":2}, {"x":6.5, "y":3, "w":2.25}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3} + ] + } + } +} diff --git a/keyboards/handwired/curiosity/keymaps/default/keymap.c b/keyboards/handwired/curiosity/keymaps/default/keymap.c new file mode 100644 index 0000000000..741ad387db --- /dev/null +++ b/keyboards/handwired/curiosity/keymaps/default/keymap.c @@ -0,0 +1,33 @@ +/* Copyright 2020 Spaceman + * + * 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 QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_small_mods( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(1), KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + [1] = LAYOUT_small_mods( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; diff --git a/keyboards/handwired/curiosity/readme.md b/keyboards/handwired/curiosity/readme.md new file mode 100644 index 0000000000..eaf608e221 --- /dev/null +++ b/keyboards/handwired/curiosity/readme.md @@ -0,0 +1,13 @@ +# The Curiosity + +40% Keyboard + +* Keyboard Maintainer: [Spaceman](https://github.com/Spaceman) +* Hardware Supported: Curiosity PCB +* Hardware Availability: N/A + +Make example for this keyboard (after setting up your build environment): + + make handwired/curiosity: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/handwired/curiosity/rules.mk b/keyboards/handwired/curiosity/rules.mk new file mode 100644 index 0000000000..dace27ef32 --- /dev/null +++ b/keyboards/handwired/curiosity/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +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 +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +LTO_ENABLE = no # Use link time optimization