From 43e88f34aa2587b16ca3f344ae7c40e2dcb5b622 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 22 Sep 2021 00:18:25 -0400 Subject: [PATCH] [Keyboard] add ein_60 (#14398) Co-authored-by: Drashna Jaelre Co-authored-by: Ryan --- keyboards/ein_60/config.h | 98 ++++++++ keyboards/ein_60/ein_60.c | 120 +++++++++ keyboards/ein_60/ein_60.h | 38 +++ keyboards/ein_60/glcdfont.c | 233 ++++++++++++++++++ keyboards/ein_60/keymaps/default/keymap.c | 208 ++++++++++++++++ keyboards/ein_60/keymaps/default/readme.md | 3 + keyboards/ein_60/keymaps/default/rules.mk | 4 + keyboards/ein_60/keymaps/klackygears/config.h | 28 +++ keyboards/ein_60/keymaps/klackygears/keymap.c | 176 +++++++++++++ .../ein_60/keymaps/klackygears/readme.md | 1 + keyboards/ein_60/keymaps/klackygears/rules.mk | 8 + keyboards/ein_60/keymaps/ledtest/keymap.c | 207 ++++++++++++++++ keyboards/ein_60/keymaps/ledtest/readme.md | 1 + keyboards/ein_60/keymaps/ledtest/rules.mk | 4 + keyboards/ein_60/readme.md | 27 ++ keyboards/ein_60/rules.mk | 26 ++ 16 files changed, 1182 insertions(+) create mode 100644 keyboards/ein_60/config.h create mode 100644 keyboards/ein_60/ein_60.c create mode 100644 keyboards/ein_60/ein_60.h create mode 100644 keyboards/ein_60/glcdfont.c create mode 100644 keyboards/ein_60/keymaps/default/keymap.c create mode 100644 keyboards/ein_60/keymaps/default/readme.md create mode 100644 keyboards/ein_60/keymaps/default/rules.mk create mode 100644 keyboards/ein_60/keymaps/klackygears/config.h create mode 100644 keyboards/ein_60/keymaps/klackygears/keymap.c create mode 100644 keyboards/ein_60/keymaps/klackygears/readme.md create mode 100644 keyboards/ein_60/keymaps/klackygears/rules.mk create mode 100644 keyboards/ein_60/keymaps/ledtest/keymap.c create mode 100644 keyboards/ein_60/keymaps/ledtest/readme.md create mode 100644 keyboards/ein_60/keymaps/ledtest/rules.mk create mode 100644 keyboards/ein_60/readme.md create mode 100644 keyboards/ein_60/rules.mk diff --git a/keyboards/ein_60/config.h b/keyboards/ein_60/config.h new file mode 100644 index 0000000000..c701f1f6d6 --- /dev/null +++ b/keyboards/ein_60/config.h @@ -0,0 +1,98 @@ +/* +Copyright 2021 klackygears + +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 0x4A53 +#define PRODUCT_ID 0x0003 +#define DEVICE_VER 0x0001 +#define MANUFACTURER klackygears +#define PRODUCT EIN_60 + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +#define MATRIX_ROW_PINS { F1, F2, F3, F4 } +#define MATRIX_COL_PINS { A3, A2, A1, A0, F6, F5, F0, E0, E1, C0, C1, C2, C3 } + +#define DIODE_DIRECTION COL2ROW + +#ifdef ENCODER_ENABLE +# define ENCODERS_PAD_A { B0, C5 } +# define ENCODERS_PAD_B { E3, C4 } +# define ENCODER_RESOLUTIONS { 4, 4 } +#endif + +#ifdef OLED_ENABLE +# define OLED_DISPLAY_128X64 +# define OLED_TIMEOUT 450000 +# define OLED_FONT_H "keyboards/ein_60/glcdfont.c" +#endif + +#ifdef AUDIO_ENABLE +# define AUDIO_PIN C6 +# define AUDIO_CLICKY +# define AUDIO_DAC_SAMPLE_MAX 4095U +#endif + +#define RGB_DI_PIN E7 +#ifdef RGB_DI_PIN +# define RGBLED_NUM 38 +# define RGBLIGHT_HUE_STEP 4 +# define RGBLIGHT_SAT_STEP 8 +# define RGBLIGHT_VAL_STEP 8 +# define RGBLIGHT_LIMIT_VAL 200 /* The maximum brightness level */ +# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +# 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 +# define RGBLIGHT_EFFECT_TWINKLE +// /*== customize breathing effect ==*/ +// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +// /*==== use exp() and sin() ====*/ +// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +#endif + +#ifdef RGB_MATRIX_ENABLE +# define DRIVER_LED_TOTAL 38 +# define RGB_MATRIX_LED_FLUSH_LIMIT 16 +# define RGB_MATRIX_STARTUP_VAL 150 +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* 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 diff --git a/keyboards/ein_60/ein_60.c b/keyboards/ein_60/ein_60.c new file mode 100644 index 0000000000..e9431edefb --- /dev/null +++ b/keyboards/ein_60/ein_60.c @@ -0,0 +1,120 @@ +/* Copyright 2021 klackygears + * + * 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 "ein_60.h" + +#ifdef RGB_MATRIX_ENABLE + + // Logical Layout + // Columns + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 + // ROWS + // 37 0 1 2 3 4 5 6 7 8 9 10 11 12 0 + // 36 13 1 + // 35 14 2 + // 34 15 3 + // 33 16 3 + // 32 17 4 + // 31 30 29 28 27 26 25 24 23 22 21 20 19 18 5 + +led_config_t g_led_config = { { + { 36, 1, 2, 3, 4, 5, 5, 6, 7, 8, 9, 10, 13 }, + { 34, 1, 2, 3, 4, 5, NO_LED, 6, 7, 8, 9, 10, 15 }, + { 33, 30, 29, 28, 27, 26, NO_LED, 23, 22, 21, 20, 19, 16 }, + { 32, 30, 29, 28, 27, 26, 24, 23, 22, 21, 20, 19, 17 } +}, { + { 30, 0 }, { 45, 0 }, { 60, 0 }, { 75, 0 }, { 90, 0 }, { 105, 0 }, { 119, 0 }, { 134, 0 }, { 149, 0 }, { 164, 0 }, { 179, 0 }, { 194, 0 }, { 209, 0 }, { 224, 11 }, + { 224, 21 }, { 224, 32 }, { 224, 43 }, { 224, 53 }, { 209, 64 }, { 194, 64 }, { 179, 64 }, { 164, 64 }, { 149, 64 }, { 134, 64 }, { 119, 64 }, { 105, 64 }, { 90, 64 }, + { 75, 64 }, { 60, 64 }, { 45, 64 }, { 30, 64 }, { 15, 64 }, { 0, 53 }, { 0, 43 }, { 0, 32 }, { 0, 21 }, { 0, 11 }, { 15, 0 }, +}, { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, +} }; +#endif + +#ifdef AUDIO_ENABLE +const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT( + 30, 31, 32, 33, 34, 35, 35, 36, 37, 38, 39, 40, 41, + 18, 9, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +); +#endif + +#ifdef OLED_ENABLE +__attribute__((weak)) void oled_task_user(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_P(PSTR("Default\n"), false); + break; + case 1: + oled_write_P(PSTR("Lower\n"), false); + break; + case 2: + oled_write_P(PSTR("Raise\n"), false); + break; + case 3: + oled_write_P(PSTR("Adjust\n"), false); + break; + case 4: + oled_write_P(PSTR("FN\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + oled_set_cursor(1,2); + oled_advance_page(true); + static const char PROGMEM ein60_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 11,251,139,139,139,139,139,139,139,139,139,139,139, 11, 15, 0,240,240, 16,240, 0,240,240, 16,240,224,192,128, 0, 0, 0, 0,240, 16,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,255, 11,251,139,139,139,139,139,139,139,139,139,139,139,143,128, 0, 0, 0, 0,254,255, 11,251, 11, 11, 11, 11,139,203,235,123,187,219,235,251,255, 7,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 4,253,197,197,197,197,197,197,197,197,197,197,199,192,192, 0,255,255, 0,255, 0,255,255, 0,254, 13, 27, 55,111,222,188,120,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0,255,197,197,197,197,197,197,197,197,197,197,253,253,255,131,254, 0, 0,255,255, 0,255,184,220,238,247,219,205,198,195,193,192,255,255,255,128,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, 2, 3, 0, 3, 3, 2, 3, 0, 0, 0, 0, 0, 1, 3, 2, 2, 3, 0, 8, 28, 20, 20, 20, 20, 20, 28, 8, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(ein60_logo, sizeof(ein60_logo)); +} +#endif + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code_delay(KC_VOLU, 10); + } else { + tap_code_delay(KC_VOLD, 10); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return true; +} +#endif diff --git a/keyboards/ein_60/ein_60.h b/keyboards/ein_60/ein_60.h new file mode 100644 index 0000000000..91bfe3acfd --- /dev/null +++ b/keyboards/ein_60/ein_60.h @@ -0,0 +1,38 @@ +/* Copyright 2021 klackygears + * + * 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 "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 LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K10, K11, K12, K13, K14, K15, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, KC_NO, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, KC_NO, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C } \ +} diff --git a/keyboards/ein_60/glcdfont.c b/keyboards/ein_60/glcdfont.c new file mode 100644 index 0000000000..f9984b62ca --- /dev/null +++ b/keyboards/ein_60/glcdfont.c @@ -0,0 +1,233 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#pragma once + +#include "progmem.h" + +static const char PROGMEM font[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x00, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x00, 0x7F, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3F, 0x00, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x01, 0x01, 0x7F, 0x01, 0x01, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x78, 0x14, 0x14, 0x78, 0x00, 0x00, + 0x7C, 0x54, 0x54, 0x28, 0x00, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x00, 0x00, + 0x7C, 0x44, 0x44, 0x38, 0x00, 0x00, + 0x7C, 0x54, 0x54, 0x44, 0x00, 0x00, + 0x7C, 0x14, 0x14, 0x04, 0x00, 0x00, + 0x38, 0x44, 0x54, 0x34, 0x00, 0x00, + 0x7C, 0x10, 0x10, 0x7C, 0x00, 0x00, + 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3C, 0x00, 0x00, + 0x7C, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, + 0x7C, 0x08, 0x70, 0x08, 0x7C, 0x00, + 0x7C, 0x08, 0x10, 0x7C, 0x00, 0x00, + 0x38, 0x44, 0x44, 0x38, 0x00, 0x00, + 0x7C, 0x14, 0x14, 0x08, 0x00, 0x00, + 0x38, 0x44, 0x24, 0x58, 0x00, 0x00, + 0x7C, 0x14, 0x34, 0x48, 0x00, 0x00, + 0x48, 0x54, 0x54, 0x24, 0x00, 0x00, + 0x04, 0x7C, 0x04, 0x00, 0x00, 0x00, + 0x3C, 0x40, 0x40, 0x3C, 0x00, 0x00, + 0x3C, 0x40, 0x20, 0x1C, 0x00, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x0C, 0x10, 0x70, 0x10, 0x0C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFC, 0xFC, 0x2C, 0xEC, 0x2C, + 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, + 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x3C, + 0x00, 0xC0, 0xC0, 0x40, 0xC0, 0x00, + 0xC0, 0xC0, 0x40, 0xC0, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0x40, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xF8, 0xFC, 0x2C, 0xEC, 0x2C, + 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, + 0x2C, 0x2C, 0x2C, 0x2C, 0x3C, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFC, + 0x2C, 0xEC, 0x2C, 0x2C, 0x2C, 0x2C, + 0x2C, 0x2C, 0xAC, 0xEC, 0xEC, 0x6C, + 0xAC, 0xEC, 0xFC, 0x1C, 0xF0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0x10, 0xF7, 0x16, + 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, + 0x16, 0x16, 0x16, 0x1E, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x00, + 0xFF, 0xFF, 0x00, 0xFB, 0x37, 0x6F, + 0xDE, 0xBC, 0x78, 0xF0, 0xE0, 0xFF, + 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x16, + 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, + 0x16, 0x16, 0x16, 0xF6, 0xF6, 0xFE, + 0x0C, 0xF8, 0x00, 0x00, 0xFF, 0xFF, + 0x00, 0xFF, 0xE0, 0x70, 0xB8, 0xDC, + 0x6E, 0x37, 0x1B, 0x0D, 0x06, 0x03, + 0xFF, 0xFF, 0xFF, 0x00, 0xFF, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0F, 0x0F, 0x08, 0x0B, 0x0B, + 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, + 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0F, + 0x00, 0x0F, 0x0F, 0x08, 0x0F, 0x00, + 0x0F, 0x0F, 0x08, 0x0F, 0x00, 0x00, + 0x00, 0x01, 0x03, 0x06, 0x0D, 0x0B, + 0x08, 0x0F, 0x00, 0x20, 0x70, 0x50, + 0x50, 0x50, 0x50, 0x50, 0x70, 0x20, + 0x00, 0x07, 0x0F, 0x0C, 0x0B, 0x0B, + 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, + 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, + 0x0E, 0x03, 0x00, 0x00, 0x07, 0x0F, + 0x0C, 0x0B, 0x0A, 0x0B, 0x0B, 0x0B, + 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, + 0x0B, 0x0B, 0x0B, 0x0E, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/keyboards/ein_60/keymaps/default/keymap.c b/keyboards/ein_60/keymaps/default/keymap.c new file mode 100644 index 0000000000..3984dabcbf --- /dev/null +++ b/keyboards/ein_60/keymaps/default/keymap.c @@ -0,0 +1,208 @@ +/* Copyright 2021 klackygears + * + * 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 layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _FUNCTION, +}; + +enum custom_keycodes { + RGBRST = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,------. ,----------------------------------------. + * | Tab | Q | W | E | R | T | | Mute | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | Func | A | S | D | F | G | | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / | ' | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | Ctrl | ` | GUI | Alt |Lower |Space | |Space | |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MUTE, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + /* Lower + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | Esc | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | | | _ | + | { | } |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | | | | Mute | | | | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | |Lower | Bksp | | | | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT( + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_MUTE, _______, KC_PIPE, + _______, _______, _______, _______, _______, KC_BSPC, _______, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + /* Raise + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | , | 0 | . |Lower | Bksp | | | | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, _______, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | | | | | | | | | |RGBRST|RGBMOD|RGBVAI|RGBSAI|RGBHUI| | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | | | | | | | |RGBRMO|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | |BLSTEP| + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | | | | | | | | | | | | RESET| + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, RGBRST, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET + ), + /* Function + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | | | | | | | | | | | | Up | | | | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | | | | | | | | | | | | | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +#ifdef OLED_ENABLE + + +static void render_ein60_logo(void) { + static const char PROGMEM ein60_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 11,251,139,139,139,139,139,139,139,139,139,139,139, 11, 15, 0,240,240, 16,240, 0,240,240, 16,240,224,192,128, 0, 0, 0, 0,240, 16,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,255, 11,251,139,139,139,139,139,139,139,139,139,139,139,143,128, 0, 0, 0, 0,254,255, 11,251, 11, 11, 11, 11,139,203,235,123,187,219,235,251,255, 7,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 4,253,197,197,197,197,197,197,197,197,197,197,199,192,192, 0,255,255, 0,255, 0,255,255, 0,254, 13, 27, 55,111,222,188,120,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0,255,197,197,197,197,197,197,197,197,197,197,253,253,255,131,254, 0, 0,255,255, 0,255,184,220,238,247,219,205,198,195,193,192,255,255,255,128,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, 2, 3, 0, 3, 3, 2, 3, 0, 0, 0, 0, 0, 1, 3, 2, 2, 3, 0, 8, 28, 20, 20, 20, 20, 20, 28, 8, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(ein60_logo, sizeof(ein60_logo)); + } + +static void render_status(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; + case _FUNCTION: + oled_write_P(PSTR("FN\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + oled_set_cursor(1,2); +} + +void oled_task_user(void) { + + render_status(); + oled_write_ln_P(PSTR(""), false); + render_ein60_logo(); +} +#endif + + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + } + return true; +} diff --git a/keyboards/ein_60/keymaps/default/readme.md b/keyboards/ein_60/keymaps/default/readme.md new file mode 100644 index 0000000000..8f9aab0435 --- /dev/null +++ b/keyboards/ein_60/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default keymap for EIN_60. + +It utilizes a nearly identical layout as the Plank. The OLED is enabled, rotary encoders are enabled, and the LEDs are enabled with RGB Matrix. You'll need to alter the rules.mk file in your own keymap to change this or simply cut the jumper pad with a hobby knife to disconnect them completely. There is an option to install a KELIKING KLJ-1102 speaker and enable with "AUDIO_ENABLE = yes" in your rules.mk file. diff --git a/keyboards/ein_60/keymaps/default/rules.mk b/keyboards/ein_60/keymaps/default/rules.mk new file mode 100644 index 0000000000..04b133f6a0 --- /dev/null +++ b/keyboards/ein_60/keymaps/default/rules.mk @@ -0,0 +1,4 @@ +# Build Options +# change yes to no to disable +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +RGB_MATRIX_ENABLE = yes # Enable for pretty RGB matrix effects diff --git a/keyboards/ein_60/keymaps/klackygears/config.h b/keyboards/ein_60/keymaps/klackygears/config.h new file mode 100644 index 0000000000..d3b1c7b4d9 --- /dev/null +++ b/keyboards/ein_60/keymaps/klackygears/config.h @@ -0,0 +1,28 @@ +/* Copyright 2021 klackygears + * + * 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 PERMISSIVE_HOLD +#define TAPPING_TERM 150 +#define IGNORE_MOD_TAP_INTERRUPT + + +#ifdef RGB_MATRIX_ENABLE + #define RGB_MATRIX_KEYPRESSES +#endif diff --git a/keyboards/ein_60/keymaps/klackygears/keymap.c b/keyboards/ein_60/keymaps/klackygears/keymap.c new file mode 100644 index 0000000000..ea1d77dea7 --- /dev/null +++ b/keyboards/ein_60/keymaps/klackygears/keymap.c @@ -0,0 +1,176 @@ +/* Copyright 2020 klackygears + * + * 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 +#include "klackygears.h" +#include "stdio.h" + +//For an explanation of what's going on here with the keymap wrappers, check out drashna's user folder. +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_WINBASE] = LAYOUT_wrapper( + KC_ESC, _______________DVORAK_L1___________________, KC_MUTE, _______________DVORAK_R1___________________, KC_BSPC, + AU_TOG, _______________DVORAK_L2___________________, _______________DVORAK_R2___________________, RGB_TOG, + CK_TOGG, _______________WINDVK_L3___________________, _______________WINDVK_R3___________________, RGB_MOD, + KC_1, KC_2, KC_3, ________WIN_THUMB_L______, KC_SPC, ________WIN_THUMB_R______, KC_1, KC_2, KC_GAMER + ), + [_MACBASE] = LAYOUT_wrapper( + KC_ESC, _______________DVORAK_L1___________________, _______, _______________DVORAK_R1___________________, KC_BSPC, + RGB_TOG, _______________DVORAK_L2___________________, _______________DVORAK_R2___________________, RGB_TOG, + RGB_MOD, _______________MACDVK_L3___________________, _______________MACDVK_R3___________________, RGB_MOD, + _______, _______, _______, ________MAC_THUMB_L______, _______, ________MAC_THUMB_R______, _______, _______, _______ + ), + [_QWERTY] = LAYOUT_wrapper( + KC_ESC, _________________COLEMAK_L1________________, KC_ESC, _________________QWERTY_R1_________________, KC_BSPC, + KC_CAPS, _________________COLEMAK_L2________________, _________________QWERTY_R2_________________, KC_ENT, + KC_LSFT, _________________COLEMAK_L3________________, _________________QWERTY_R3_________________, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, _______, MO(_MNMB), MO(_SYMB), KC_SPC, MO(_SYMB), MO(_MNMB), KC_RGUI,_______, MO(_MDIA), MO(_FUNC) + ), + + //Borderlands + [_GAMER] = LAYOUT_wrapper( + KC_ESC, KC_R, KC_G, KC_W, KC_E, KC_1, _______, _________________RGB_1_____________________, KC_WINBASE, + KC_TAB, KC_V, KC_A, KC_S, KC_D, KC_2, _________________RGB_2_____________________, _______, + KC_C, KC_I, KC_F, KC_Q, KC_4, KC_3, _________________MEDIA_____________________, _______, + KC_Z, KC_X, KC_K, KC_LCTL, KC_LSFT, KC_SPC, KC_SPC, KC_F12, KC_P, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT + ), + + [_SYMB] = LAYOUT_wrapper( + _______, _________________PUNC_L1_ALT_______________, _______, _________________PUNC_R1___________________, _______, + _______, _________________PUNC_L3___________________, _________________PUNC_R2___________________, _______, + RGB_MOD, _________________PUNC_L3_ALT_______________, _________________PUNC_R3___________________, _______, + _______, _______, KC_NLCK, KC_SLCK, KC_DEL, _______, _______, _______, KC_CAPS, _______, _______, _______, _______ + ), + + [_FUNC] = LAYOUT_wrapper( + _______, _____________FUNC_L1_______________________, _______, _______, _____________FUNC_1_______________, _______, + _______, ________MAC_MISSION_CTRL__________, LGUI(KC_L), _______, _____________FUNC_2_______________, _______, + RGB_MOD, _____________FUNC_L3_______________________, _______, _____________FUNC_3_______________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_CAPS, _______, _______, _______, _______ + ), + + [_MNMB] = LAYOUT_wrapper( + _______, _________________MACNAV_L1_________________, _______, _________________NUMB_R1___________________, _______, + _______, _________________MACNAV_L2_________________, _________________NUMB_R2___________________, _______, + RGB_MOD, _________________MACNAV_L3_________________, _________________NUMB_R3_MAC_______________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, RSFT_T(KC_ENT), KC_RSFT, _______, _______, _______ + ), + + + [_NUMB] = LAYOUT_wrapper( + _______, _________________WINNAV_L1_________________, _______, _________________NUMB_R1___________________, _______, + _______, _________________WINNAV_L2_________________, _________________NUMB_R2___________________, _______, + RGB_MOD, _________________WINNAV_L3_________________, _________________NUMB_R3_WIN_______________, _______, + _______, _______, _______, TO(_WINBASE), _______, _______, _______, _______, RSFT_T(KC_ENT), KC_RSFT, _______, _______, _______ + ), + + [_MDIA] = LAYOUT_wrapper( + _______, _________________LYOUT_____________________, _______, _________________RGB_1_____________________, RGB_TOG, + _______, MU_TOG, _______, _______, _______, CK_UP, _________________RGB_2_____________________, _______, + RGB_MOD, MU_MOD, MU_TOG, CK_TOGG, CK_RST, CK_DOWN, _________________MEDIA_____________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + + +#ifdef OLED_ENABLE + + char wpm_str[10]; + +static void render_ein60_logo(void) { + static const char PROGMEM ein60_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 11,251,139,139,139,139,139,139,139,139,139,139,139, 11, 15, 0,240,240, 16,240, 0,240,240, 16,240,224,192,128, 0, 0, 0, 0,240, 16,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,255, 11,251,139,139,139,139,139,139,139,139,139,139,139,143,128, 0, 0, 0, 0,254,255, 11,251, 11, 11, 11, 11,139,203,235,123,187,219,235,251,255, 7,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 4,253,197,197,197,197,197,197,197,197,197,197,199,192,192, 0,255,255, 0,255, 0,255,255, 0,254, 13, 27, 55,111,222,188,120,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0,255,197,197,197,197,197,197,197,197,197,197,253,253,255,131,254, 0, 0,255,255, 0,255,184,220,238,247,219,205,198,195,193,192,255,255,255,128,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, 2, 3, 0, 3, 3, 2, 3, 0, 0, 0, 0, 0, 1, 3, 2, 2, 3, 0, 8, 28, 20, 20, 20, 20, 20, 28, 8, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(ein60_logo, sizeof(ein60_logo)); + } + + + +static void render_status(void) { +//void oled_task_user(void) { + + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case _WINBASE: + oled_write_P(PSTR("Base\n"), false); + break; + case _SYMB: + oled_write_P(PSTR("Symbol\n"), false); + break; + case _FUNC: + oled_write_P(PSTR("FN\n"), false); + break; + case _MNMB: + oled_write_P(PSTR("Numbpad Mac\n"), false); + break; + case _NUMB: + oled_write_P(PSTR("Numbpad\n"), false); + break; + case _MDIA: + oled_write_P(PSTR("Media\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + + sprintf(wpm_str, "WPM: %03d", get_current_wpm()); + oled_set_cursor(1,2); + oled_write(wpm_str, false); + +} + +void oled_task_user(void) { + + render_status(); + oled_write_ln_P(PSTR(""), false); + render_ein60_logo(); + +} + +#endif + + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return true; +} + + diff --git a/keyboards/ein_60/keymaps/klackygears/readme.md b/keyboards/ein_60/keymaps/klackygears/readme.md new file mode 100644 index 0000000000..f97a08bd09 --- /dev/null +++ b/keyboards/ein_60/keymaps/klackygears/readme.md @@ -0,0 +1 @@ +This is the klackygears userspace keymap for EIN_60. My userspace is heavily based on Drashna's userspace and draws a lot of features from him. diff --git a/keyboards/ein_60/keymaps/klackygears/rules.mk b/keyboards/ein_60/keymaps/klackygears/rules.mk new file mode 100644 index 0000000000..885ab5bafe --- /dev/null +++ b/keyboards/ein_60/keymaps/klackygears/rules.mk @@ -0,0 +1,8 @@ + +# Build Options +# change yes to no to disable +ENCODER_ENABLE = yes # Enables the use of one or more encoders +WPM_ENABLE = yes # Enables the WPM counter on the OLED +RGB_MATRIX_ENABLE = yes # Enable for pretty RGB matrix effects +AUDIO_ENABLE = yes +TAP_DANCE_ENABLE = yes diff --git a/keyboards/ein_60/keymaps/ledtest/keymap.c b/keyboards/ein_60/keymaps/ledtest/keymap.c new file mode 100644 index 0000000000..6f903124af --- /dev/null +++ b/keyboards/ein_60/keymaps/ledtest/keymap.c @@ -0,0 +1,207 @@ +/* Copyright 2021 klackygears + * + * 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 layer_names { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _FUNCTION, + }; + +enum custom_keycodes { + RGBRST = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,------. ,----------------------------------------. + * | Tab | Q | W | E | R | T | | Esc | |RGBRST|RGBHUI|RGBSAI|RGBVAI|RGBSPI| Bksp | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | Func | A | S | D | F | G | |RGBRMO|RGBHUD|RGBSAD|RGBVAD|RGBSPD|Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | |RGBTOG| M | , | . | / | ' | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | Ctrl | ` | GUI | Alt |Lower |Space | |Space | |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MUTE, RGBRST, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_BSPC, + MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_ENT, + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, RGB_TOG, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, KC_SPC, KC_CAPS, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + /* Lower + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | Esc | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | | | _ | + | { | } |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | | | | | Mute | | | | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | |Lower | Bksp | | | | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT( + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, KC_MUTE, _______, KC_PIPE, + _______, _______, _______, _______, _______, KC_BSPC, _______, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + /* Raise + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | , | 0 | . |Lower | Bksp | | | | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, _______, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | | | | | | | | | |RGBRST|RGBMOD|RGBVAI|RGBSAI|RGBHUI| | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | | | | | | | |RGBRMO|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | |BLSTEP| + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | | | | | | | | | | | | RESET| + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, RGBRST, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, _______, + _______, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET + ), + /* Function + * ,-----------------------------------------. ,------. ,-----------------------------------------. + * | | | | | | | | | | | | Up | | | | + * |------+------+------+------+------+------| `------' |------+------+------+------+------+------| + * | | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | | + * |------+------+------|--------------------+ ,------. +--------------------|------+------+------| + * | | | | | | | | | | | | | | | | + * `-----------------------------------------' `------' `-----------------------------------------' + */ + [_FUNCTION] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +layer_state_t layer_state_set_user(layer_state_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +#ifdef OLED_ENABLE + + +static void render_ein60_logo(void) { + static const char PROGMEM ein60_logo[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 11,251,139,139,139,139,139,139,139,139,139,139,139, 11, 15, 0,240,240, 16,240, 0,240,240, 16,240,224,192,128, 0, 0, 0, 0,240, 16,240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,254,255, 11,251,139,139,139,139,139,139,139,139,139,139,139,143,128, 0, 0, 0, 0,254,255, 11,251, 11, 11, 11, 11,139,203,235,123,187,219,235,251,255, 7,252, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 4,253,197,197,197,197,197,197,197,197,197,197,199,192,192, 0,255,255, 0,255, 0,255,255, 0,254, 13, 27, 55,111,222,188,120,255, 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255,255, 0,255,197,197,197,197,197,197,197,197,197,197,253,253,255,131,254, 0, 0,255,255, 0,255,184,220,238,247,219,205,198,195,193,192,255,255,255,128,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 3, 3, 2, 3, 0, 3, 3, 2, 3, 0, 0, 0, 0, 0, 1, 3, 2, 2, 3, 0, 8, 28, 20, 20, 20, 20, 20, 28, 8, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 1, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + }; + oled_write_raw_P(ein60_logo, sizeof(ein60_logo)); + } + +static void render_status(void) { + // Host Keyboard Layer Status + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case _QWERTY: + oled_write_P(PSTR("Default\n"), false); + break; + case _LOWER: + oled_write_P(PSTR("Lower\n"), false); + break; + case _RAISE: + oled_write_P(PSTR("Raise\n"), false); + break; + case _ADJUST: + oled_write_P(PSTR("Adjust\n"), false); + break; + case _FUNCTION: + oled_write_P(PSTR("FN\n"), false); + break; + default: + // Or use the write_ln shortcut over adding '\n' to the end of your string + oled_write_ln_P(PSTR("Undefined"), false); + } + + // Host Keyboard LED Status + led_t led_state = host_keyboard_led_state(); + oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false); + oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false); + oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false); + + oled_set_cursor(1,2); +} + +void oled_task_user(void) { + + render_status(); + oled_write_ln_P(PSTR(""), false); + render_ein60_logo(); +} +#endif + + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { /* Second encoder */ + if (clockwise) { + tap_code(KC_DOWN); + } else { + tap_code(KC_UP); + } + } + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + } + return true; +} diff --git a/keyboards/ein_60/keymaps/ledtest/readme.md b/keyboards/ein_60/keymaps/ledtest/readme.md new file mode 100644 index 0000000000..17954c3322 --- /dev/null +++ b/keyboards/ein_60/keymaps/ledtest/readme.md @@ -0,0 +1 @@ +# The keymap for testing the LEDs and OLED on the EIN_60 diff --git a/keyboards/ein_60/keymaps/ledtest/rules.mk b/keyboards/ein_60/keymaps/ledtest/rules.mk new file mode 100644 index 0000000000..a628544562 --- /dev/null +++ b/keyboards/ein_60/keymaps/ledtest/rules.mk @@ -0,0 +1,4 @@ +# Build Options +# change yes to no to disable +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +RGB_MATRIX_ENABLE = no # Enable for pretty RGB matrix effects diff --git a/keyboards/ein_60/readme.md b/keyboards/ein_60/readme.md new file mode 100644 index 0000000000..bbcf05f967 --- /dev/null +++ b/keyboards/ein_60/readme.md @@ -0,0 +1,27 @@ +# Ein_60 + +![Ein_60](https://i.imgur.com/cKPrNwO.jpeg) + +The Ein_60 is a 50 key ergo style column stagger keyboard PCB with a combined split layout that is designed to fit into a standard 60% tray mount case. It has USB C and comes in either hotswap or soldered versions. (Soldered version is Alps and MX compatible.) It can have two encoders in either of it's middle keys and an OLED installed in the center below the plate. The PCB supports a bottom mounted KELIKING KLJ-1102 low profile buzzer speaker for audio effects. It has 38 side facing LEDs around the entire outside edge of the PCB for very bright RGB effects as well as solder points for LED strips. The Ein_60 is compatible with the majority of Planck keycap sets and can have a 1U only layout, two 2U and two 1U, or two 3U keys in the thumb cluster (or any combination of those). + + +When flashing the Ein_60 use: make ein_60:default:flash + +![Ein_60 in 3D printed 60% case](https://i.imgur.com/3jkrERV.jpeg) + +* Keyboard Maintainer: [klackygears](https://github.com/klackygears) +* Hardware Supported: The Ein_60 PCBs +* Hardware Availability: [Case Data & firmware](https://github.com/klackygears) + +Make example for this keyboard (after setting up your build environment): + + make ein_60:default + +Flashing example for this keyboard: + + make ein_60: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). + +![Ein_60 PCB](https://i.imgur.com/5A1xW8S.jpeg) +![Ein_60 with FR4 plate](https://i.imgur.com/42DNsLY.jpeg) diff --git a/keyboards/ein_60/rules.mk b/keyboards/ein_60/rules.mk new file mode 100644 index 0000000000..47cbb0c12f --- /dev/null +++ b/keyboards/ein_60/rules.mk @@ -0,0 +1,26 @@ +# MCU name +MCU = at90usb1286 + +# Bootloader selection +BOOTLOADER = qmk-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +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 +# 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 = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output +RGB_MATRIX_ENABLE = no # Enable for pretty RGB matrix effects +RGB_MATRIX_DRIVER = WS2812 # Define RGB Matrix +ENCODER_ENABLE = yes # Enables the use of one or more encoders +OLED_ENABLE = yes # Enables the use of OLED displays +OLED_DRIVER = SSD1306