From edd71157666ece4af764bc913b170cc9b787f619 Mon Sep 17 00:00:00 2001 From: Jan Lunge Date: Wed, 19 May 2021 23:03:44 -0400 Subject: [PATCH] 3by2 macropad --- keyboards/3by2/3by2.c | 1 + keyboards/3by2/3by2.h | 7 ++++ keyboards/3by2/config.h | 28 +++++++++++++ keyboards/3by2/info.json | 50 +++++++++++++++++++++++ keyboards/3by2/keymaps/default/keymap.c | 8 ++++ keyboards/3by2/keymaps/via/keymap.c | 54 +++++++++++++++++++++++++ keyboards/3by2/keymaps/via/rules.mk | 2 + keyboards/3by2/keymaps/via/vial.json | 24 +++++++++++ keyboards/3by2/readme.md | 21 ++++++++++ keyboards/3by2/rules.mk | 19 +++++++++ 10 files changed, 214 insertions(+) create mode 100644 keyboards/3by2/3by2.c create mode 100644 keyboards/3by2/3by2.h create mode 100644 keyboards/3by2/config.h create mode 100644 keyboards/3by2/info.json create mode 100644 keyboards/3by2/keymaps/default/keymap.c create mode 100644 keyboards/3by2/keymaps/via/keymap.c create mode 100644 keyboards/3by2/keymaps/via/rules.mk create mode 100644 keyboards/3by2/keymaps/via/vial.json create mode 100644 keyboards/3by2/readme.md create mode 100644 keyboards/3by2/rules.mk diff --git a/keyboards/3by2/3by2.c b/keyboards/3by2/3by2.c new file mode 100644 index 00000000000..d2e1669d82b --- /dev/null +++ b/keyboards/3by2/3by2.c @@ -0,0 +1 @@ +#include "3by2.h" diff --git a/keyboards/3by2/3by2.h b/keyboards/3by2/3by2.h new file mode 100644 index 00000000000..fbdbaa14623 --- /dev/null +++ b/keyboards/3by2/3by2.h @@ -0,0 +1,7 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_h( K00, K01, K02, K03, K04, K05 ) \ +{ { K00, K01, K02 }, { K03, K04, K05 } } +#define LAYOUT LAYOUT_h diff --git a/keyboards/3by2/config.h b/keyboards/3by2/config.h new file mode 100644 index 00000000000..a5667ee2019 --- /dev/null +++ b/keyboards/3by2/config.h @@ -0,0 +1,28 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xEEEE +#define PRODUCT_ID 0x2019 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Jan Lunge +#define PRODUCT 3by2 + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 3 + +/* key matrix pins for beccas board*/ +#define MATRIX_ROW_PINS { F6,B2 } +#define MATRIX_COL_PINS { F7, B1, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 +#define VIAL_KEYBOARD_UID {0x6F, 0xD2, 0x03, 0xC4, 0x16, 0xAF, 0x61, 0x27} +#define VIAL_UNLOCK_COMBO_ROWS { 0, 2 } +#define VIAL_UNLOCK_COMBO_COLS { 0, 1 } diff --git a/keyboards/3by2/info.json b/keyboards/3by2/info.json new file mode 100644 index 00000000000..587c6269380 --- /dev/null +++ b/keyboards/3by2/info.json @@ -0,0 +1,50 @@ +{ + "keyboard_name": "3by2", + "keyboard": "3by2", + "url": "https://blog.heaper.de/3d-printed-macropad/", + "maintainer": "wlard", + "width": 3, + "height": 2, + "keymap": "default", + "layouts": { + "LAYOUT_horizontal": { + "key_count": 6, + "layout": [ + { + "x": 0, + "y": 0 + }, + { + "x": 1, + "y": 0 + }, + { + "x": 2, + "y": 0 + }, + { + "x": 0, + "y": 1 + }, + { + "x": 1, + "y": 1 + }, + { + "x": 2, + "y": 1 + } + ] + } + }, + "layers": [ + [ + "KC_F13", + "KC_F14", + "KC_F15", + "KC_F16", + "KC_F17", + "KC_F18" + ] + ] +} \ No newline at end of file diff --git a/keyboards/3by2/keymaps/default/keymap.c b/keyboards/3by2/keymaps/default/keymap.c new file mode 100644 index 00000000000..697724da37a --- /dev/null +++ b/keyboards/3by2/keymaps/default/keymap.c @@ -0,0 +1,8 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_h( + KC_F13 , KC_F14 , KC_F15, + KC_F16 , KC_F17 , KC_F18 + ) +}; diff --git a/keyboards/3by2/keymaps/via/keymap.c b/keyboards/3by2/keymaps/via/keymap.c new file mode 100644 index 00000000000..4c491e9dee9 --- /dev/null +++ b/keyboards/3by2/keymaps/via/keymap.c @@ -0,0 +1,54 @@ +#include QMK_KEYBOARD_H +#include "raw_hid.h" +#include "quantum.h" + +#define ____ KC_TRNS +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( + KC_F13 , KC_F14 , KC_F15, + KC_F16 , KC_F17 , KC_F18 + ), + + [1] = LAYOUT( + ____, ____, ____, + ____, ____, ____ + ), + + [2] = LAYOUT( + ____, ____, ____, + ____, ____, ____ + ), + + [3] = LAYOUT( + ____, ____, ____, + ____, ____, ____ + ), + +}; + +void raw_hid_receive_kb(uint8_t *data, uint8_t length) { + if(data[0] == 0xFC){ + switch (data[1]) { + case 0x01:{ + // move to layer + data[1] = 0xFD; + layer_move(data[2]); + break; + } + case 0x02:{ + // turn on layer + data[1] = 0xFD; + layer_on(data[2]); + break; + } + case 0x03:{ + // turn off layer + data[1] = 0xFD; + layer_off(data[2]); + break; + } + } + } + raw_hid_send(data, length); +} diff --git a/keyboards/3by2/keymaps/via/rules.mk b/keyboards/3by2/keymaps/via/rules.mk new file mode 100644 index 00000000000..79b8374ce51 --- /dev/null +++ b/keyboards/3by2/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +VIAL_ENABLE = yes diff --git a/keyboards/3by2/keymaps/via/vial.json b/keyboards/3by2/keymaps/via/vial.json new file mode 100644 index 00000000000..1a21b454599 --- /dev/null +++ b/keyboards/3by2/keymaps/via/vial.json @@ -0,0 +1,24 @@ +{ + "name": "3by2", + "vendorId": "0xEEEE", + "productId": "0x2019", + "lighting": "none", + "matrix": { + "rows": 2, + "cols": 3 + }, + "layouts": { + "keymap": [ + [ + "0,0", + "0,1", + "0,2" + ], + [ + "1,0", + "1,1", + "1,2" + ] + ] + } +} diff --git a/keyboards/3by2/readme.md b/keyboards/3by2/readme.md new file mode 100644 index 00000000000..12fa3f46199 --- /dev/null +++ b/keyboards/3by2/readme.md @@ -0,0 +1,21 @@ +# 3by2 + ┌───┬───┬───┐ + │K00│K01│K02│ + ├───┼───┼───┤ + │K03│K04│K05│ + └───┴───┴───┘ + +A 6 key mechanical keypad. + +Keyboard Maintainer: [wlard](https://github.com/wlard) + + +Make example for this keyboard (after setting up your build environment): + + make 3by2:default + +or with vial support + + make 3by2:via + +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/3by2/rules.mk b/keyboards/3by2/rules.mk new file mode 100644 index 00000000000..c3412e769e3 --- /dev/null +++ b/keyboards/3by2/rules.mk @@ -0,0 +1,19 @@ +# 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 + +EXTRAKEY_ENABLE = yes +NKRO_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +MOUSEKEY_ENABLE = yes +