From f3d790195027935574fd5f73d0c2e409e01f5266 Mon Sep 17 00:00:00 2001 From: Jordan Blackbourn Date: Fri, 30 Jul 2021 03:23:27 +1200 Subject: [PATCH] [Keyboard] Added Orthocode keyboard (#13487) Co-authored-by: Drashna Jaelre Co-authored-by: Ryan --- keyboards/orthocode/config.h | 93 +++++++++++ keyboards/orthocode/info.json | 84 ++++++++++ keyboards/orthocode/keymaps/default/keymap.c | 159 +++++++++++++++++++ keyboards/orthocode/orthocode.c | 16 ++ keyboards/orthocode/orthocode.h | 35 ++++ keyboards/orthocode/readme.md | 17 ++ keyboards/orthocode/rules.mk | 26 +++ 7 files changed, 430 insertions(+) create mode 100644 keyboards/orthocode/config.h create mode 100644 keyboards/orthocode/info.json create mode 100644 keyboards/orthocode/keymaps/default/keymap.c create mode 100644 keyboards/orthocode/orthocode.c create mode 100644 keyboards/orthocode/orthocode.h create mode 100644 keyboards/orthocode/readme.md create mode 100644 keyboards/orthocode/rules.mk diff --git a/keyboards/orthocode/config.h b/keyboards/orthocode/config.h new file mode 100644 index 00000000000..823a48e368c --- /dev/null +++ b/keyboards/orthocode/config.h @@ -0,0 +1,93 @@ +/*Copyright 2020 Jrodna + +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" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Jrodna +#define PRODUCT OrthoCode + + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ + +#define MATRIX_ROW_PINS {B0, B1, B2, B3, B4} +#define MATRIX_COL_PINS {C4, C3, C2, C1, C0, D7, D6, A7, A4, A5, A6, A3, A2, A1, A0} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL*/ +#define DIODE_DIRECTION COL2ROW + +#define USB_MAX_POWER_CONSUMPTION 100 + +#define ENCODERS_PAD_A { D1 } +#define ENCODERS_PAD_B { D0 } +#define ENCODER_RESOLUTION 1 +#define TAP_CODE_DELAY 10 + +#define RGB_DI_PIN D5 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 10 /*Change for the number of leds on the strip you attach*/ + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ + #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +// #define DEBOUNCE 5 +#define DEBOUNCE 0 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* 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 + +/* Bootmagic Lite key configuration */ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/orthocode/info.json b/keyboards/orthocode/info.json new file mode 100644 index 00000000000..fec4da90bf2 --- /dev/null +++ b/keyboards/orthocode/info.json @@ -0,0 +1,84 @@ +{ + "keyboard_name": "OrthoCode", + "url": "https://github.com/Jrodna/OrthoCode", + "maintainer": "Jrodna", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Game", "x":0.5, "y":1}, + {"label":"Esc", "x":1.75, "y":1}, + {"label":"", "x":3, "y":1}, + {"label":"", "x":4, "y":1}, + {"label":"", "x":5, "y":1}, + {"label":"", "x":6, "y":1}, + {"label":"", "x":7, "y":1}, + {"label":"", "x":10.5, "y":1}, + {"label":"", "x":11.5, "y":1}, + {"label":"", "x":12.5, "y":1}, + {"label":"", "x":13.5, "y":1}, + {"label":"", "x":14.5, "y":1}, + {"label":"_", "x":15.5, "y":1}, + {"label":"+", "x":16.5, "y":1}, + {"label":"Home", "x":17.5, "y":1}, + {"label":"M1", "x":0.25, "y":2}, + {"label":"Tab", "x":1.5, "y":2, "w":1.5}, + {"label":"Q", "x":3, "y":2}, + {"label":"W", "x":4, "y":2}, + {"label":"E", "x":5, "y":2}, + {"label":"R", "x":6, "y":2}, + {"label":"T", "x":7, "y":2}, + {"label":"Y", "x":10.5, "y":2}, + {"label":"U", "x":11.5, "y":2}, + {"label":"I", "x":12.5, "y":2}, + {"label":"O", "x":13.5, "y":2}, + {"label":"P", "x":14.5, "y":2}, + {"label":"|", "x":15.5, "y":2, "w":1.5}, + {"label":"Delete", "x":17, "y":2}, + {"label":"End", "x":18, "y":2}, + {"label":"M2", "x":0, "y":3}, + {"label":"Ctrl", "x":1.25, "y":3, "w":1.75}, + {"label":"A", "x":3, "y":3}, + {"label":"S", "x":4, "y":3}, + {"label":"D", "x":5, "y":3}, + {"label":"F", "x":6, "y":3}, + {"label":"G", "x":7, "y":3}, + {"label":"H", "x":10.5, "y":3}, + {"label":"J", "x":11.5, "y":3}, + {"label":"K", "x":12.5, "y":3}, + {"label":"L", "x":13.5, "y":3}, + {"label":":", "x":14.5, "y":3}, + {"label":"\"", "x":15.5, "y":3}, + {"label":"Enter", "x":16.5, "y":3, "w":2.25}, + {"label":"Rotary", "x":0.5, "y":0}, + {"label":"Layer", "x":0.75, "y":4, "w":2.25}, + {"label":"Z", "x":3, "y":4}, + {"label":"X", "x":4, "y":4}, + {"label":"C", "x":5, "y":4}, + {"label":"V", "x":6, "y":4}, + {"label":"B", "x":7, "y":4}, + {"label":"N", "x":10.5, "y":4}, + {"label":"M", "x":11.5, "y":4}, + {"label":"<", "x":12.5, "y":4}, + {"label":">", "x":13.5, "y":4}, + {"label":"?", "x":14.5, "y":4}, + {"label":"\u2191", "x":17, "y":4}, + {"label":"Ctrl", "x":1.25, "y":5, "w":1.25}, + {"label":"Win", "x":2.5, "y":5, "w":1.25}, + {"label":"Alt", "x":3.75, "y":5, "w":1.25}, + {"label":"Fn", "x":5.5, "y":5, "w":1.25}, + {"label":"th1", "x":6.75, "y":5, "h":2.75}, + {"label":"th2", "x":7.75, "y":5.25, "h":2.25}, + {"label":"th3", "x":9.75, "y":5.25, "h":2.25}, + {"label":"th4", "x":10.75, "y":5, "h":2.75}, + {"label":"Fn", "x":11.75, "y":5, "w":1.25}, + {"label":"Alt", "x":13, "y":5, "w":1.25}, + {"label":"Ctrl", "x":14.25, "y":5, "w":1.25}, + {"label":"\u2190", "x":16, "y":5}, + {"label":"\u2193", "x":17, "y":5}, + {"label":"\u2192", "x":18, "y":5}] + } + } +} + diff --git a/keyboards/orthocode/keymaps/default/keymap.c b/keyboards/orthocode/keymaps/default/keymap.c new file mode 100644 index 00000000000..11a20102c3d --- /dev/null +++ b/keyboards/orthocode/keymaps/default/keymap.c @@ -0,0 +1,159 @@ +/* Copyright 2020 Jrodna + * + * 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 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SHIFTSPACE, + ILIKEFROG +}; + +#define KC_SHSP SHIFTSPACE +#define KC_FROG ILIKEFROG + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + TG(2), KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_HOME, + RGB_TOG, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_DEL, KC_END, + RGB_MOD, KC_LCTL, 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__MUTE, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_RSFT, KC_ENT, KC_BSPC, KC_SHSP, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + [1] = LAYOUT( + /* esc 1 2 3 4 5 6 7 8 9 0 - = home */ + TG(3), KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + /* tab Q W E R T Y U I O P \ delete end */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,KC_TRNS, KC_TRNS, LSFT(KC_LBRC), LSFT(KC_RBRC), KC_TRNS, KC_TRNS, KC_PAUS, KC_TRNS, + /* caps A S D F G H J K L ; ' enter */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS, + /* shift Z X C V B N M , . / up */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_EQL, LSFT(KC_EQL), LSFT(KC_9), LSFT(KC_0), KC_TRNS, KC_VOLU, + /* ctrl win alt fn th1 th2 th3 th4 fn alt ctrl left down right*/ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_TRNS), + [2] = LAYOUT( + /* esc 1 2 3 4 5 6 7 8 9 0 - = home */ + 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, + /* tab Q W E R T Y U I O P \ delete end */ + 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_PAUS, KC_TRNS, + /* caps A S D F G H J K L ; ' enter */ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS, + /* Rotary shift Z X C V B N M , . / up */ + KC_TRNS, KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + /* ctrl win alt fn th1 th2 th3 th4 fn alt ctrl left down right*/ + KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [3] = LAYOUT( + /* esc 1 2 3 4 5 6 7 8 9 0 - = home */ + TG(3), KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, + /* tab Q W E R T Y U I O P \ delete end */ + KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, + /* caps A S D F G H J K L ; ' enter */ + KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, + /* Rotary shift Z X C V B N M , . / up */ + KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, + /* ctrl win alt fn th1 th2 th3 th4 fn alt ctrl left down right*/ + KC_FROG, KC_FROG, KC_FROG, MO(1), KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG, KC_FROG), + +}; + + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static bool shiftspace_mods = false; + static int frogchar = 0; + switch (keycode) { + case SHIFTSPACE: + if (record->event.pressed) { + if(get_mods() & MOD_BIT(KC_RSFT)) { + register_code(KC_MINS); + shiftspace_mods = true; + } + else { + register_code(KC_SPC); + } + } else { + if (shiftspace_mods) { + unregister_code(KC_MINS); + shiftspace_mods = false; + } else { + unregister_code(KC_SPC); + } + } + return false; + break; + case ILIKEFROG: + if (record->event.pressed) { + switch (frogchar) + { + case 0: + SEND_STRING("I"); + break; + case 1: + SEND_STRING(" "); + break; + case 2: + SEND_STRING("L"); + break; + case 3: + SEND_STRING("i"); + break; + case 4: + SEND_STRING("k"); + break; + case 5: + SEND_STRING("e"); + break; + case 6: + SEND_STRING(" "); + break; + case 7: + SEND_STRING("F"); + break; + case 8: + SEND_STRING("r"); + break; + case 9: + SEND_STRING("o"); + break; + case 10: + SEND_STRING("g"); + break; + case 11: + SEND_STRING(" "); + break; + } + frogchar = (frogchar + 1) % 12; + } + break; + } + return true; + +} + + +#ifdef ENCODER_ENABLE +bool encoder_update_user(uint8_t index, bool clockwise) { + // Volume control + if (clockwise) { + tap_code(KC_VOLD); + } else { + tap_code(KC_VOLU); + } + return true; +} +#endif diff --git a/keyboards/orthocode/orthocode.c b/keyboards/orthocode/orthocode.c new file mode 100644 index 00000000000..8de13e2abe2 --- /dev/null +++ b/keyboards/orthocode/orthocode.c @@ -0,0 +1,16 @@ +/* Copyright 2020 Jrodna + * + * 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 "orthocode.h" \ No newline at end of file diff --git a/keyboards/orthocode/orthocode.h b/keyboards/orthocode/orthocode.h new file mode 100644 index 00000000000..83da0413033 --- /dev/null +++ b/keyboards/orthocode/orthocode.h @@ -0,0 +1,35 @@ +/* Copyright 2020 Jrodna + * + * 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 + +#define _x_ KC_NO + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E \ +) { \ +{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ +{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ +{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, _x_ }, \ +{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, _x_, K3D, _x_ }, \ +{ _x_, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E} \ +} diff --git a/keyboards/orthocode/readme.md b/keyboards/orthocode/readme.md new file mode 100644 index 00000000000..4a2dfc01bf8 --- /dev/null +++ b/keyboards/orthocode/readme.md @@ -0,0 +1,17 @@ +# ORTHOCODE + +An ortholinear keyboard with thumb clusters that can be assembled with only through hole components, including usb type-c and compatibility for standard keysets. + +* Keyboard Maintainer: [Jrodna](https://github.com/Jrodna) +* Hardware Supported: OrthoCode, atmega32a +* Hardware Availability: [GitHub](https://github.com/Jrodna/OrthoCode) + +Make example for this keyboard (after setting up your build environment): + + make orthocode:default + +Flashing example for this keyboard: + + make orthocode:default:flash + +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/orthocode/rules.mk b/keyboards/orthocode/rules.mk new file mode 100644 index 00000000000..2a8d321a55a --- /dev/null +++ b/keyboards/orthocode/rules.mk @@ -0,0 +1,26 @@ +# MCU name +MCU = atmega32a + +# Processor frequency +F_CPU = 16000000 + +# Bootloader selection +BOOTLOADER = USBasp + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes # Enables the use of one or more encoders