From 4edc8fc3c70c30dbcc927dbfc8570369cbc325d6 Mon Sep 17 00:00:00 2001 From: Martin Karlsson Date: Thu, 26 Dec 2019 16:45:14 +0100 Subject: [PATCH] K-Nunmpad17 (#7708) * Initial commit for K-Nunmpad * Changed layoutname Corrected the files according to drashnas suggestions. * Some names have been changed * Some code thats not been used has been removed * Fixed rules.mk When adding the commnity layout, tapdancing broke. This was fixed with rules.mk was changed in the k-numpad and karlssn keymap. * Cleanup according fauxpark Cleaned up the readme.md and the rules.mk according to feedback from fauxpark. --- keyboards/handwired/k_numpad17/config.h | 53 ++++++++++++++++ keyboards/handwired/k_numpad17/k_numpad17.c | 1 + keyboards/handwired/k_numpad17/k_numpad17.h | 35 +++++++++++ .../k_numpad17/keymaps/default/keymap.c | 24 ++++++++ .../k_numpad17/keymaps/karlssn/keymap.c | 61 +++++++++++++++++++ .../k_numpad17/keymaps/karlssn/rules.mk | 1 + keyboards/handwired/k_numpad17/readme.md | 25 ++++++++ keyboards/handwired/k_numpad17/rules.mk | 31 ++++++++++ 8 files changed, 231 insertions(+) create mode 100644 keyboards/handwired/k_numpad17/config.h create mode 100644 keyboards/handwired/k_numpad17/k_numpad17.c create mode 100644 keyboards/handwired/k_numpad17/k_numpad17.h create mode 100644 keyboards/handwired/k_numpad17/keymaps/default/keymap.c create mode 100644 keyboards/handwired/k_numpad17/keymaps/karlssn/keymap.c create mode 100644 keyboards/handwired/k_numpad17/keymaps/karlssn/rules.mk create mode 100644 keyboards/handwired/k_numpad17/readme.md create mode 100644 keyboards/handwired/k_numpad17/rules.mk diff --git a/keyboards/handwired/k_numpad17/config.h b/keyboards/handwired/k_numpad17/config.h new file mode 100644 index 000000000..e14101ede --- /dev/null +++ b/keyboards/handwired/k_numpad17/config.h @@ -0,0 +1,53 @@ +/* +Copyright 2012 Jun Wako + +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 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Handwired +#define PRODUCT K-Numpad17 +#define DESCRIPTION QMK keyboard firmware for handwired numpad with 17 keys + +#define TAPPING_TERM 400 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS { D1, D4, C6, D7, E6 } +#define MATRIX_COL_PINS { B2, B1, F6 , F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* 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/k_numpad17/k_numpad17.c b/keyboards/handwired/k_numpad17/k_numpad17.c new file mode 100644 index 000000000..290a86aac --- /dev/null +++ b/keyboards/handwired/k_numpad17/k_numpad17.c @@ -0,0 +1 @@ +#include "k_numpad17.h" \ No newline at end of file diff --git a/keyboards/handwired/k_numpad17/k_numpad17.h b/keyboards/handwired/k_numpad17/k_numpad17.h new file mode 100644 index 000000000..1fc99794d --- /dev/null +++ b/keyboards/handwired/k_numpad17/k_numpad17.h @@ -0,0 +1,35 @@ +#pragma once +#include "quantum.h" + +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT_numpad_5x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, \ + k20, k21, k22, k13, \ + k30, k31, k32, \ + k40, k41, k33 \ +) \ +{ \ + {k00, k01, k02, k03}, \ + {k10, k11, k12, k13}, \ + {k20, k21, k22, KC_NO}, \ + {k30, k31, k32, k33}, \ + {k40, KC_NO, k41, KC_NO} \ +} + +/* matrix layout + * ,-------------------. + * | 00 | 01 | 02 | 03 | + * |----|----|----|----| + * | 10 | 11 | 12 | | + * |----|----|----| 13 | + * | 20 | 21 | 22 | | + * |----|----|----|----| + * | 30 | 31 | 32 | | + * |----|----|----| 33 | + * | 40 | 41 | | + * `-------------------' + */ + + diff --git a/keyboards/handwired/k_numpad17/keymaps/default/keymap.c b/keyboards/handwired/k_numpad17/keymaps/default/keymap.c new file mode 100644 index 000000000..2f383eea9 --- /dev/null +++ b/keyboards/handwired/k_numpad17/keymaps/default/keymap.c @@ -0,0 +1,24 @@ +#include QMK_KEYBOARD_H +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ,-------------------. + * | NL | / | * | - | + * |----|----|----|----| + * | 7 | 8 | 9 | | + * |----|----|----| + | + * | 4 | 5 | 6 | | + * |----|----|----|----| + * | 1 | 2 | 3 | | + * |----|----|----| En | + * | 0 | . | | + * `-------------------' + */ + + [0] = LAYOUT_numpad_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_PDOT, KC_PENT + ), +}; diff --git a/keyboards/handwired/k_numpad17/keymaps/karlssn/keymap.c b/keyboards/handwired/k_numpad17/keymaps/karlssn/keymap.c new file mode 100644 index 000000000..c2f314116 --- /dev/null +++ b/keyboards/handwired/k_numpad17/keymaps/karlssn/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +//Tap Dance Declarations +enum { + TD_DOT_COMMAS = 0 +}; + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Esc, twice for Caps Lock + [TD_DOT_COMMAS] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_COMMA) +// Other declarations would go here, separated by commas, if you have them +}; + +//In Layer declaration, add tap dance item in place of a key code + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ,-------------------. + * |bcsp| / | * | - | + * |----|----|----|----| + * | 7 | 8 | 9 | | + * |----|----|----| + | + * | 4 | 5 | 6 | | + * |----|----|----|----| + * | 1 | 2 | 3 | | + * |----|----|----| En | + * | FN/0 | . | | + * `-------------------' + */ + + [0] = LAYOUT_numpad_5x4( + KC_BSPC, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, + LT(1, KC_P0), TD(TD_DOT_COMMAS), KC_PENT + ), + /* + * ,-------------------. + * | F10| F11| F12| - | + * |----|----|----|----| + * | F7 | F8 | F9 | | + * |----|----|----| vol| + * | F4 | F5 | F6 | + | + * |----|----|----|----| + * | F1 | F2 | F3 | vol| + * |----|----|----| - | + * | FN | . | | + * `-------------------' + */ + [1] = LAYOUT_numpad_5x4( + KC_F10, KC_F11, KC_F12, KC_NO, + KC_F7, KC_F8, KC_F9, + KC_F4, KC_F5, KC_F6, KC_VOLU, + KC_F1, KC_F2, KC_F3, + KC_NO, KC_PDOT, KC_VOLD + ) +}; diff --git a/keyboards/handwired/k_numpad17/keymaps/karlssn/rules.mk b/keyboards/handwired/k_numpad17/keymaps/karlssn/rules.mk new file mode 100644 index 000000000..e5ddcae8d --- /dev/null +++ b/keyboards/handwired/k_numpad17/keymaps/karlssn/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/handwired/k_numpad17/readme.md b/keyboards/handwired/k_numpad17/readme.md new file mode 100644 index 000000000..76bbaf439 --- /dev/null +++ b/keyboards/handwired/k_numpad17/readme.md @@ -0,0 +1,25 @@ +# K-Numpad17 +k-numpad + +### Arduino Pro Micro Pinout +| rows | 0 | 1 | 2 | 3 | 4 | +| ----------- | --- | --- | --- | --- | --- | +| arduino pin | 2 | 4 | 5 | 6 | 7 | +| qmk pin | D1 | D4 | C6 | D7 | E6 | + +| columns | 0 | 1 | 2 | 3 | +| ----------- | --- | --- | --- | --- | +| arduino pin | 16 | 15 | A1 | A3 | +| qmk pin | B5 | B4 | B3 | C3 | + + +Make example for this keyboard (after setting up your build environment): + + make handwired/k_numpad17:default + +Bootmagic is enabled. Press the key at (0,0) while plugging the keyboard in to jump to bootloader. This is numlock in the default keymap. + +* Keyboard Maintainer: [Karlssn](https://github.com/Karlssn) +* Hardware Availability: [Casefile](https://www.thingiverse.com/thing:4062409) + +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). \ No newline at end of file diff --git a/keyboards/handwired/k_numpad17/rules.mk b/keyboards/handwired/k_numpad17/rules.mk new file mode 100644 index 000000000..e1f2d2a14 --- /dev/null +++ b/keyboards/handwired/k_numpad17/rules.mk @@ -0,0 +1,31 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# ATmega32A bootloadHID +# ATmega328P USBasp +BOOTLOADER = caterina + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = lite # Key at 0,0 makes the keyboard go into bootloader +MOUSEKEY_ENABLE = no # 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 # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +TAP_DANCE_ENABLE = no + +LAYOUTS = numpad_5x4