From b291cd25862f69c13468e6744d0cb86caf153601 Mon Sep 17 00:00:00 2001 From: Andrew Litt Date: Tue, 28 Mar 2023 20:48:18 -0500 Subject: [PATCH] Add Koolertron AMAG09 9 key macropad (#421) * Add Koolertron AMAG09 9 key macropad * Fix default keymap for koolertron/amag09 * Move as much as possible from C into info.json, fix layout name, and remove unnecessary LOCKING_ flags --- keyboards/koolertron/amag09/info.json | 48 ++++++++++++++++++ .../amag09/keymaps/default/keymap.c | 49 +++++++++++++++++++ .../koolertron/amag09/keymaps/vial/config.h | 9 ++++ .../koolertron/amag09/keymaps/vial/keymap.c | 49 +++++++++++++++++++ .../koolertron/amag09/keymaps/vial/rules.mk | 3 ++ .../koolertron/amag09/keymaps/vial/vial.json | 29 +++++++++++ keyboards/koolertron/amag09/readme.md | 29 +++++++++++ keyboards/koolertron/amag09/rules.mk | 1 + 8 files changed, 217 insertions(+) create mode 100644 keyboards/koolertron/amag09/info.json create mode 100644 keyboards/koolertron/amag09/keymaps/default/keymap.c create mode 100644 keyboards/koolertron/amag09/keymaps/vial/config.h create mode 100644 keyboards/koolertron/amag09/keymaps/vial/keymap.c create mode 100644 keyboards/koolertron/amag09/keymaps/vial/rules.mk create mode 100644 keyboards/koolertron/amag09/keymaps/vial/vial.json create mode 100644 keyboards/koolertron/amag09/readme.md create mode 100644 keyboards/koolertron/amag09/rules.mk diff --git a/keyboards/koolertron/amag09/info.json b/keyboards/koolertron/amag09/info.json new file mode 100644 index 0000000000..68d62403b9 --- /dev/null +++ b/keyboards/koolertron/amag09/info.json @@ -0,0 +1,48 @@ +{ + "keyboard_name": "AMAG09", + "manufacturer": "Koolertron", + "url": "http://www.koolertron.com/koolertron-one-handed-macro-mechanical-keyboard-rgb-led-backlit-portable-mini-onehanded-mechanical-gaming-keypad-23-fully-programmable-keys-blue-switches-p-874.html", + "maintainer": "al177", + "usb": { + "vid": "0x4B54", + "pid": "0x2323", + "device_version": "0.0.1" + }, + "bootloader": "bootloadhid", + "processor": "atmega32a", + "features": { + "backlight": true, + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true + }, + "diode_direction": "ROW2COL", + "matrix_size": { + "cols": 3, + "rows": 3 + }, + "matrix_pins": { + "cols": ["B0", "B1", "B2"], + "rows": ["A0", "A1", "A2"] + }, + "backlight": { + "pin": "D4" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"K00", "matrix": [0, 0], "x":0, "y":0}, + {"label":"K01", "matrix": [0, 1], "x":1, "y":0}, + {"label":"K02", "matrix": [0, 2], "x":2, "y":0}, + {"label":"K10", "matrix": [1, 0], "x":0, "y":1}, + {"label":"K11", "matrix": [1, 1], "x":1, "y":1}, + {"label":"K12", "matrix": [1, 2], "x":2, "y":1}, + {"label":"K20", "matrix": [2, 0], "x":0, "y":2}, + {"label":"K21", "matrix": [2, 1], "x":1, "y":2}, + {"label":"K22", "matrix": [2, 2], "x":2, "y":2} + ] + } + } +} diff --git a/keyboards/koolertron/amag09/keymaps/default/keymap.c b/keyboards/koolertron/amag09/keymaps/default/keymap.c new file mode 100644 index 0000000000..4dcdf5cf8a --- /dev/null +++ b/keyboards/koolertron/amag09/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2023 + * + * 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 + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + BASE, + FN1, + FN2, + FN3 +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT( + KC_KP_7, KC_KP_8, KC_KP_9, + KC_KP_4, KC_KP_5, KC_KP_6, + KC_KP_1, KC_KP_2, KC_KP_3 + ), + [FN1] = LAYOUT( + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), + [FN2] = LAYOUT( + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), + [FN3] = LAYOUT( + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), +}; +// clang-format on diff --git a/keyboards/koolertron/amag09/keymaps/vial/config.h b/keyboards/koolertron/amag09/keymaps/vial/config.h new file mode 100644 index 0000000000..cdd63d48e4 --- /dev/null +++ b/keyboards/koolertron/amag09/keymaps/vial/config.h @@ -0,0 +1,9 @@ +/* Vial configuration */ + +#pragma once + +#define VIAL_KEYBOARD_UID {0x1C, 0xA6, 0x8B, 0xCD, 0xCB, 0x42, 0x5C, 0x6F} + + +#define VIAL_UNLOCK_COMBO_ROWS { 0, 2 } +#define VIAL_UNLOCK_COMBO_COLS { 2, 0 } diff --git a/keyboards/koolertron/amag09/keymaps/vial/keymap.c b/keyboards/koolertron/amag09/keymaps/vial/keymap.c new file mode 100644 index 0000000000..e96512ae23 --- /dev/null +++ b/keyboards/koolertron/amag09/keymaps/vial/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2023 + * + * 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 + +// Defines names for use in layer keycodes and the keymap +enum layer_names { + BASE, + FN1, + FN2, + FN3 +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [BASE] = LAYOUT( + KC_KP_7, KC_KP_8, KC_KP_9, + KC_KP_4, KC_KP_5, KC_KP_6, + MO(FN1), KC_KP_2, KC_KP_3 + ), + [FN1] = LAYOUT( + BL_TOGG, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), + [FN2] = LAYOUT( + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), + [FN3] = LAYOUT( + _______, _______, _______, + _______, _______, _______, + _______, _______, _______ + ), +}; +// clang-format on diff --git a/keyboards/koolertron/amag09/keymaps/vial/rules.mk b/keyboards/koolertron/amag09/keymaps/vial/rules.mk new file mode 100644 index 0000000000..46f9f1360f --- /dev/null +++ b/keyboards/koolertron/amag09/keymaps/vial/rules.mk @@ -0,0 +1,3 @@ +VIA_ENABLE = yes +VIAL_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/koolertron/amag09/keymaps/vial/vial.json b/keyboards/koolertron/amag09/keymaps/vial/vial.json new file mode 100644 index 0000000000..31f380ce89 --- /dev/null +++ b/keyboards/koolertron/amag09/keymaps/vial/vial.json @@ -0,0 +1,29 @@ +{ + "name": "Koolertron AMAG09", + "vendorId": "0x4B54", + "productId": "0x2323", + "lighting": "qmk_backlight", + "matrix" : { + "rows": 3, + "cols": 3 + }, + "layouts" : { + "keymap" : [ + [ + "0,0", + "0,1", + "0,2" + ], + [ + "1,0", + "1,1", + "1,2" + ], + [ + "2,0", + "2,1", + "2,2" + ] + ] + } +} diff --git a/keyboards/koolertron/amag09/readme.md b/keyboards/koolertron/amag09/readme.md new file mode 100644 index 0000000000..07782c496c --- /dev/null +++ b/keyboards/koolertron/amag09/readme.md @@ -0,0 +1,29 @@ +# AMAG09 (Koolertron) + +![Koolertron AMAG09](https://i.imgur.com/mepvkTe.jpg) + +One Handed Macro Mechanical Keyboard, 9 Key with optional RGB backlighting. + +- Keyboard Maintainer: [al177](https://github.com/al177) +- Hardware Supported: AMAG09 (ATmega32A) +- Hardware Availability: + - [Amazon](https://www.amazon.com/Koolertron-Mechanical-Keyboard-One-Handed-Programmable/dp/B0998QM9L2) + +Make example for this keyboard (after setting up your build environment): + + make koolertron/amag09:default + +Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid)) + + make amag09:default:flash + make amag09:vial:flash + +**Reset Key**: Hold down the *upper left* key while plugging in the keyboard. + +**Tips**: +- The keyboard comes with bootloadHID installed from factory. +- The configuration here is for the single color LED keyboard. RGB versions are presumed to be i2c like the amag23 + +Based on keyboards/amag23 by ianmclinden + +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/koolertron/amag09/rules.mk b/keyboards/koolertron/amag09/rules.mk new file mode 100644 index 0000000000..ad892c12c4 --- /dev/null +++ b/keyboards/koolertron/amag09/rules.mk @@ -0,0 +1 @@ +# Placeholder so this board is recognized as a target