浏览代码

Adding TGR Tris/Tris CE Numpad (#9139)

* Add TGR Tris

* Update readme.md

* Update rules.mk

* Update keyboards/tgr/tris/keymaps/default/keymap.c

Co-authored-by: Joel Challis <git@zvecr.com>

* Update keyboards/tgr/tris/keymaps/via/keymap.c

Co-authored-by: Joel Challis <git@zvecr.com>

* Update keyboards/tgr/tris/keymaps/default/keymap.c

Co-authored-by: Drashna Jaelre <drashna@live.com>

* Update keyboards/tgr/tris/keymaps/via/keymap.c

Co-authored-by: Drashna Jaelre <drashna@live.com>

* Update keyboards/tgr/tris/tris.h

Co-authored-by: Drashna Jaelre <drashna@live.com>

* Update keyboards/tgr/tris/info.json

Co-authored-by: Joel Challis <git@zvecr.com>

* update formatting

* Revert "update formatting"

This reverts commit ae2d6832673985a874f7f43d42bdb56679d851d6.

Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
halfenergized 5 年之前
父节点
当前提交
a9b3c0a807

+ 50 - 0
keyboards/tgr/tris/config.h

@@ -0,0 +1,50 @@
+/*
+Copyright 2020 halfenergized
+
+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 <http://www.gnu.org/licenses/>.
+*/
+
+#pragma once
+
+#include "config_common.h"
+
+#define VENDOR_ID 0x5447  //TG
+#define PRODUCT_ID 0x5452 //TR
+#define DEVICE_VER 0x0001
+#define MANUFACTURER TGR
+#define PRODUCT Tris
+#define DESCRIPTION Numpad by TGR
+
+#define MATRIX_ROWS 6
+#define MATRIX_COLS 4
+
+#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5 }
+#define MATRIX_COL_PINS { A3, A2, A1, A0 }
+
+#define DIODE_DIRECTION COL2ROW
+#define DEBOUNCE 5
+
+#define BACKLIGHT_PIN D4
+#define BACKLIGHT_LEVELS 3
+
+#define RGBLED_NUM 6
+#define RGBLIGHT_ANIMATIONS
+
+/* key combination for magic key command */
+/* defined by default; to change, uncomment and set to the combination you want */
+// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
+
+/* Bootmagic Lite key configuration */
+// #define BOOTMAGIC_LITE_ROW 0
+// #define BOOTMAGIC_LITE_COLUMN 0

+ 16 - 0
keyboards/tgr/tris/info.json

@@ -0,0 +1,16 @@
+{
+    "keyboard_name": "TGR Tris",
+    "url": "",
+    "maintainer": "halfenergized",
+    "width": 4,
+    "height": 6,
+    "layouts": {
+        "LAYOUT_ortho_6x4": {
+            "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":0, "y":2.25}, {"x":1, "y":2.25}, {"x":2, "y":2.25}, {"x":3, "y":2.25}, {"x":0, "y":3.25}, {"x":1, "y":3.25}, {"x":2, "y":3.25}, {"x":3, "y":3.25}, {"x":0, "y":4.25}, {"x":1, "y":4.25}, {"x":2, "y":4.25}, {"x":3, "y":4.25}, {"x":0, "y":5.25}, {"x":1, "y":5.25}, {"x":2, "y":5.25}, {"x":3, "y":5.25}]
+        },
+
+        "LAYOUT_numpad_6x4": {
+            "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":0, "y":2.25}, {"x":1, "y":2.25}, {"x":2, "y":2.25}, {"x":0, "y":3.25}, {"x":1, "y":3.25}, {"x":2, "y":3.25}, {"x":3, "y":2.25, "h":2}, {"x":0, "y":4.25}, {"x":1, "y":4.25}, {"x":2, "y":4.25}, {"x":0, "y":5.25, "w":2}, {"x":2, "y":5.25}, {"x":3, "y":4.25, "h":2}]
+        }
+    }
+}

+ 47 - 0
keyboards/tgr/tris/keymaps/default/keymap.c

@@ -0,0 +1,47 @@
+/* Copyright 2020 halfenergized
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+#include QMK_KEYBOARD_H
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+    [0] = LAYOUT_numpad_6x4(
+        KC_ESC,  KC_TAB,  MO(1),   KC_BSPC,
+        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
+    ),
+
+    [1] = LAYOUT_numpad_6x4(
+        KC_TRNS,   KC_TRNS, KC_TRNS, MO(2),
+        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+        KC_HOME, KC_UP,   KC_PGUP,
+        KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
+        KC_END,  KC_DOWN, KC_PGDN,
+        KC_INS,           KC_DEL,  KC_TRNS
+    ),
+
+    [2] = LAYOUT_numpad_6x4(
+        RESET,   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
+    )
+};

+ 1 - 0
keyboards/tgr/tris/keymaps/default/readme.md

@@ -0,0 +1 @@
+# The default keymap for tris

+ 57 - 0
keyboards/tgr/tris/keymaps/via/keymap.c

@@ -0,0 +1,57 @@
+/* Copyright 2020 halfenergized
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+#include QMK_KEYBOARD_H
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+    [0] = LAYOUT_numpad_6x4(
+        KC_ESC,  KC_TAB,  MO(1),   KC_BSPC,
+        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
+    ),
+
+    [1] = LAYOUT_numpad_6x4(
+        KC_TRNS,   KC_TRNS, KC_TRNS, MO(2),
+        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+        KC_HOME, KC_UP,   KC_PGUP,
+        KC_LEFT, KC_TRNS, KC_RGHT, KC_TRNS,
+        KC_END,  KC_DOWN, KC_PGDN,
+        KC_INS,           KC_DEL,  KC_TRNS
+    ),
+
+    [2] = LAYOUT_numpad_6x4(
+        RESET,   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
+    ),
+
+    [3] = LAYOUT_numpad_6x4(
+        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
+    )
+
+};

+ 4 - 0
keyboards/tgr/tris/keymaps/via/rules.mk

@@ -0,0 +1,4 @@
+VIA_ENABLE = yes
+LTO_ENABLE = yes
+
+EXTRAKEY_ENABLE = no

+ 19 - 0
keyboards/tgr/tris/readme.md

@@ -0,0 +1,19 @@
+# TGR Tris/Tris CE
+
+A short description of the keyboard/project
+
+* Keyboard Maintainer: [poisonking](https://github.com/halfenergized)
+* Hardware Supported: Tris PCB
+* Hardware Availability: https://geekhack.org/index.php?topic=86221.0
+
+Make example for this keyboard (after setting up your build environment):
+
+    make tris:default
+
+Flashing example for this keyboard ([after setting up the bootloadHID flashing environment](https://docs.qmk.fm/#/flashing_bootloadhid))
+
+    make tris:default:flash
+
+**Reset Key**: Hold down the key located at top right position, while plugging in the keyboard.
+
+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).

+ 26 - 0
keyboards/tgr/tris/rules.mk

@@ -0,0 +1,26 @@
+# MCU name
+MCU = atmega32a
+
+# Bootloader selection
+#   Teensy       halfkay
+#   Pro Micro    caterina
+#   Atmel DFU    atmel-dfu
+#   LUFA DFU     lufa-dfu
+#   QMK DFU      qmk-dfu
+#   ATmega32A    bootloadHID
+#   ATmega328P   USBasp
+BOOTLOADER = bootloadHID
+
+# Build Options
+#   change yes to no to disable
+#
+BOOTMAGIC_ENABLE = no
+MOUSEKEY_ENABLE = no
+EXTRAKEY_ENABLE = yes
+CONSOLE_ENABLE = no
+COMMAND_ENABLE = yes
+BACKLIGHT_ENABLE = yes
+RGBLIGHT_ENABLE = yes
+WS2812_DRIVER = i2c
+
+LAYOUTS = numpad_6x4 ortho_6x4

+ 33 - 0
keyboards/tgr/tris/tris.c

@@ -0,0 +1,33 @@
+/* Copyright 2020 halfenergized
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include "tris.h"
+
+void keyboard_pre_init_kb(void) {
+    led_init_ports();
+    keyboard_pre_init_user();
+}
+
+void led_init_ports(void) {
+    setPinOutput(D0);
+}
+
+bool led_update_kb(led_t led_state) {
+    if (led_update_user(led_state)) {
+        writePin(D0, led_state.num_lock);
+    }
+    return true;
+}

+ 63 - 0
keyboards/tgr/tris/tris.h

@@ -0,0 +1,63 @@
+/* Copyright 2020 halfenergized
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "quantum.h"
+
+/* This is a shortcut to help you visually see your layout.
+ *
+ * The first section contains all of the arguments representing the physical
+ * layout of the board and position of the keys.
+ *
+ * The second converts the arguments into a two-dimensional array which
+ * represents the switch matrix.
+ */
+#define ___ KC_NO
+
+#define LAYOUT_ortho_6x4( \
+    k00, k01, k02, k03,  \
+    k10, k11, k12, k13,  \
+    k20, k21, k22, k23,  \
+    k30, k31, k32, k33,  \
+    k40, k41, k42, k43,  \
+    k50, k51, k52, k53   \
+)\
+{ \
+    { k00, k01, k02, k03 },  \
+    { k10, k11, k12, k13 },  \
+    { k20, k21, k22, k23 },  \
+    { k30, k31, k32, k33 },  \
+    { k40, k41, k42, k43 },  \
+    { k50, k51, k52, k53 }   \
+}
+
+#define LAYOUT_numpad_6x4( \
+    k00, k01, k02, k03, \
+    k10, k11, k12, k13, \
+    k20, k21, k22,      \
+    k30, k31, k32, k33, \
+    k40, k41, k42,      \
+    k50,      k52, k43  \
+) \
+{ \
+    { k00, k01, k02, k03 }, \
+    { k10, k11, k12, k13 }, \
+    { k20, k21, k22, ___ }, \
+    { k30, k31, k32, k33 }, \
+    { k40, k41, k42, k43 }, \
+    { k50, ___, k52, ___ }  \
+}