diff --git a/keyboards/crkbd/crkbd.c b/keyboards/crkbd/crkbd.c new file mode 100644 index 00000000000..2ac0e63125f --- /dev/null +++ b/keyboards/crkbd/crkbd.c @@ -0,0 +1,163 @@ +/* +Copyright 2019 @foostan +Copyright 2020 Drashna Jaelre <@drashna> + +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 "quantum.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__((weak)) const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + // Left + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}}, + {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}}, + {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}, + {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}}, + // Right + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}} +}; +#endif + +#ifdef OLED_ENABLE + +oled_rotation_t oled_init_kb(oled_rotation_t rotation) { + if (!is_keyboard_master()) { + return OLED_ROTATION_180; // flips the display 180 degrees if offhand + } + return rotation; +} + +static void oled_render_layer_state(void) { + oled_write_P(PSTR("Layer: "), false); + switch (get_highest_layer(layer_state)) { + case 0: + oled_write_ln_P(PSTR("Default"), false); + break; + case 1: + oled_write_ln_P(PSTR("Lower"), false); + break; + case 2: + oled_write_ln_P(PSTR("Raise"), false); + break; + case 3: + oled_write_ln_P(PSTR("Adjust"), false); + break; + default: + oled_write_ln_P(PSTR("Undef"), false); + break; + } +} + +char key_name = ' '; +uint16_t last_keycode; +uint8_t last_row; +uint8_t last_col; + +static const char PROGMEM code_to_name[60] = {' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; + +static void set_keylog(uint16_t keycode, keyrecord_t *record) { + // save the row and column (useful even if we can't find a keycode to show) + last_row = record->event.key.row; + last_col = record->event.key.col; + + key_name = ' '; + last_keycode = keycode; + if (IS_QK_MOD_TAP(keycode)) { + if (record->tap.count) { + keycode = QK_MOD_TAP_GET_TAP_KEYCODE(keycode); + } else { + keycode = 0xE0 + biton(QK_MOD_TAP_GET_MODS(keycode) & 0xF) + biton(QK_MOD_TAP_GET_MODS(keycode) & 0x10); + } + } else if (IS_QK_LAYER_TAP(keycode) && record->tap.count) { + keycode = QK_LAYER_TAP_GET_TAP_KEYCODE(keycode); + } else if (IS_QK_MODS(keycode)) { + keycode = QK_MODS_GET_BASIC_KEYCODE(keycode); + } else if (IS_QK_ONE_SHOT_MOD(keycode)) { + keycode = 0xE0 + biton(QK_ONE_SHOT_MOD_GET_MODS(keycode) & 0xF) + biton(QK_ONE_SHOT_MOD_GET_MODS(keycode) & 0x10); + } + if (keycode > ARRAY_SIZE(code_to_name)) { + return; + } + + // update keylog + key_name = pgm_read_byte(&code_to_name[keycode]); +} + +static const char *depad_str(const char *depad_str, char depad_char) { + while (*depad_str == depad_char) + ++depad_str; + return depad_str; +} + +static void oled_render_keylog(void) { + oled_write_char('0' + last_row, false); + oled_write_P(PSTR("x"), false); + oled_write_char('0' + last_col, false); + oled_write_P(PSTR(", k"), false); + const char *last_keycode_str = get_u16_str(last_keycode, ' '); + oled_write(depad_str(last_keycode_str, ' '), false); + oled_write_P(PSTR(":"), false); + oled_write_char(key_name, false); +} + +// static void render_bootmagic_status(bool status) { +// /* Show Ctrl-Gui Swap options */ +// static const char PROGMEM logo[][2][3] = { +// {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}, +// {{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, +// }; +// if (status) { +// oled_write_ln_P(logo[0][0], false); +// oled_write_ln_P(logo[0][1], false); +// } else { +// oled_write_ln_P(logo[1][0], false); +// oled_write_ln_P(logo[1][1], false); +// } +// } + +__attribute__((weak)) void oled_render_logo(void) { + // clang-format off + static const char PROGMEM crkbd_logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; + // clang-format on + oled_write_P(crkbd_logo, false); +} + +bool oled_task_kb(void) { + if (!oled_task_user()) { + return false; + } + if (is_keyboard_master()) { + oled_render_layer_state(); + oled_render_keylog(); + } else { + oled_render_logo(); + } + return false; +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + set_keylog(keycode, record); + } + return process_record_user(keycode, record); +} +#endif // OLED_ENABLE diff --git a/keyboards/crkbd/info.json b/keyboards/crkbd/info.json new file mode 100644 index 00000000000..aa92654c59d --- /dev/null +++ b/keyboards/crkbd/info.json @@ -0,0 +1,36 @@ +{ + "keyboard_name": "Corne", + "manufacturer": "foostan", + "url": "", + "maintainer": "qmk", + "usb": { + "vid": "0x4653", + "pid": "0x0001", + "device_version": "0.0.1" + }, + "rgb_matrix": { + "driver": "ws2812" + }, + "features": { + "bootmagic": true, + "extrakey": false, + "mousekey": true, + "nkro": true, + "oled": false + }, + "build": { + "lto": true + }, + "matrix_pins": { + "cols": [ "F4", "F5", "F6", "F7", "B1", "B3" ], + "rows": [ "D4", "C6", "D7", "E6" ] + }, + "diode_direction": "COL2ROW", + "split": { + "enabled": true + }, + "processor": "atmega32u4", + "pin_compatible": "promicro", + "board": "GENERIC_RP_RP2040", + "community_layouts": [ "split_3x5_3", "split_3x6_3" ] +} diff --git a/keyboards/crkbd/lib/glcdfont.c b/keyboards/crkbd/lib/glcdfont.c new file mode 100644 index 00000000000..41041f12bb3 --- /dev/null +++ b/keyboards/crkbd/lib/glcdfont.c @@ -0,0 +1,232 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#include "progmem.h" + +// Standard ASCII 5x7 font +const unsigned char font[] PROGMEM = { +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, +0x3E, 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, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 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, +0x03, 0x01, 0x7F, 0x01, 0x03, 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, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 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, 0xC0, 0xE0, +0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, +0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, +0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, +0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, +0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, +0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, +0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, +0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, +0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, +0xE0, 0xE0, 0xC0, 0x80, 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, 0xF8, 0xFC, 0xFE, +0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x81, +0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, +0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, +0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, +0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 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, 0x03, 0x0F, 0x1F, +0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, +0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, +0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x03, 0x07, 0x07, +0x07, 0x07, 0x07, 0x07, 0x07, 0x07, +0x03, 0x01, 0x00, 0x00, 0x00, 0x00, +0x01, 0x03, 0x07, 0x07, 0x07, 0x07, +0x07, 0x07, 0x07, 0x07, 0x03, 0x01, +0x00, 0x00, 0x00, 0x07, 0x07, 0x07, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x07, 0x07, 0x07, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x07, 0x07, +0x07, 0x00, 0x00, 0x00, 0x01, 0x03, +0x07, 0x07, 0x07, 0x07, 0x07, 0x07, +0x07, 0x07, 0x03, 0x01, 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/crkbd/lib/host_led_state_reader.c b/keyboards/crkbd/lib/host_led_state_reader.c new file mode 100644 index 00000000000..8602134f699 --- /dev/null +++ b/keyboards/crkbd/lib/host_led_state_reader.c @@ -0,0 +1,16 @@ +#include +#include "led.h" +#include "host.h" + +char host_led_state_str[24]; + +const char *read_host_led_state(void) +{ + led_t led_state = host_keyboard_led_state(); + snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", + (led_state.num_lock) ? "on" : "- ", + (led_state.caps_lock) ? "on" : "- ", + (led_state.scroll_lock) ? "on" : "- "); + + return host_led_state_str; +} diff --git a/keyboards/crkbd/lib/keylogger.c b/keyboards/crkbd/lib/keylogger.c new file mode 100644 index 00000000000..84d2f8913db --- /dev/null +++ b/keyboards/crkbd/lib/keylogger.c @@ -0,0 +1,46 @@ +#include +#include +#include "action.h" + +char keylog_str[24] = {}; +char keylogs_str[21] = {}; +int keylogs_str_idx = 0; + +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void set_keylog(uint16_t keycode, keyrecord_t *record) { + char name = ' '; + if (keycode < 60) { + name = code_to_name[keycode]; + } + + // update keylog + snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", + record->event.key.row, record->event.key.col, + keycode, name); + + // update keylogs + if (keylogs_str_idx == sizeof(keylogs_str) - 1) { + keylogs_str_idx = 0; + for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { + keylogs_str[i] = ' '; + } + } + + keylogs_str[keylogs_str_idx] = name; + keylogs_str_idx++; +} + +const char *read_keylog(void) { + return keylog_str; +} + +const char *read_keylogs(void) { + return keylogs_str; +} diff --git a/keyboards/crkbd/lib/layer_state_reader.c b/keyboards/crkbd/lib/layer_state_reader.c new file mode 100644 index 00000000000..f1030cae099 --- /dev/null +++ b/keyboards/crkbd/lib/layer_state_reader.c @@ -0,0 +1,38 @@ +#include +#include "action_layer.h" + +// in the future, should use (1U<<_LAYER_NAME) instead, but needs to be moved to keymap,c +#define L_BASE 0 +#define L_LOWER 2 +#define L_RAISE 4 +#define L_ADJUST 8 +#define L_ADJUST_TRI 14 + +char layer_state_str[24]; + +const char *read_layer_state(void) { + switch (layer_state) + { + case L_BASE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); + break; + case L_RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case L_LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case L_ADJUST: + case L_ADJUST_TRI: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: +#if defined (LAYER_STATE_32BIT) + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); +#else + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%d", layer_state); +#endif + } + + return layer_state_str; +} diff --git a/keyboards/crkbd/lib/logo_reader.c b/keyboards/crkbd/lib/logo_reader.c new file mode 100644 index 00000000000..039a538cc54 --- /dev/null +++ b/keyboards/crkbd/lib/logo_reader.c @@ -0,0 +1,9 @@ +const char *read_logo(void) { + static char logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; + + return logo; +} diff --git a/keyboards/crkbd/lib/mode_icon_reader.c b/keyboards/crkbd/lib/mode_icon_reader.c new file mode 100644 index 00000000000..9dadd6ac86b --- /dev/null +++ b/keyboards/crkbd/lib/mode_icon_reader.c @@ -0,0 +1,14 @@ +#include + +char mode_icon[24]; + +const char *read_mode_icon(bool swap) { + static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + if (swap == false) { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]); + } else { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]); + } + + return mode_icon; +} diff --git a/keyboards/crkbd/lib/rgb_state_reader.c b/keyboards/crkbd/lib/rgb_state_reader.c new file mode 100644 index 00000000000..8ba0cda8df7 --- /dev/null +++ b/keyboards/crkbd/lib/rgb_state_reader.c @@ -0,0 +1,15 @@ +#ifdef RGBLIGHT_ENABLE + +#include +#include "rgblight.h" + +extern rgblight_config_t rgblight_config; +char rbf_info_str[24]; +const char *read_rgb_info(void) { + + snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d", + rgblight_config.enable ? "on" : "- ", rgblight_config.mode, + rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + return rbf_info_str; +} +#endif diff --git a/keyboards/crkbd/lib/timelogger.c b/keyboards/crkbd/lib/timelogger.c new file mode 100644 index 00000000000..83fe9706ddc --- /dev/null +++ b/keyboards/crkbd/lib/timelogger.c @@ -0,0 +1,16 @@ +#include +#include "timer.h" + +char timelog_str[24] = {}; +int last_time = 0; +int elapsed_time = 0; + +void set_timelog(void) { + elapsed_time = timer_elapsed(last_time); + last_time = timer_read(); + snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); +} + +const char *read_timelog(void) { + return timelog_str; +} diff --git a/keyboards/crkbd/post_config.h b/keyboards/crkbd/post_config.h new file mode 100644 index 00000000000..aaf405a5bf9 --- /dev/null +++ b/keyboards/crkbd/post_config.h @@ -0,0 +1,49 @@ +/* Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) + * + * 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 + +#ifndef BOOTMAGIC_ROW +# define BOOTMAGIC_ROW 0 +#endif +#ifndef BOOTMAGIC_COLUMN +# define BOOTMAGIC_COLUMN 1 +#endif + +#ifndef BOOTMAGIC_ROW_RIGHT +# define BOOTMAGIC_ROW_RIGHT 4 +#endif +#ifndef BOOTMAGIC_COLUMN_RIGHT +# define BOOTMAGIC_COLUMN_RIGHT 1 +#endif + +#ifdef RGBLIGHT_ENABLE +# ifndef RGBLIGHT_LIMIT_VAL +# define RGBLIGHT_LIMIT_VAL 120 +# endif +#endif + +#ifdef RGB_MATRIX_ENABLE +# ifndef RGB_MATRIX_MAXIMUM_BRIGHTNESS +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 +# endif +#endif + +#ifdef OLED_ENABLE + #ifndef OLED_FONT_H + #define OLED_FONT_H "keyboards/crkbd/lib/glcdfont.c" + #endif +#endif diff --git a/keyboards/crkbd/readme.md b/keyboards/crkbd/readme.md new file mode 100644 index 00000000000..4297ee56d90 --- /dev/null +++ b/keyboards/crkbd/readme.md @@ -0,0 +1,109 @@ +# Corne Keyboard (CRKBD) + +Also known (incorrectly) as the `HeliDox`. + +![Crkbd](https://user-images.githubusercontent.com/736191/40575636-6fba63a4-6123-11e8-9ca0-3f990f1f9f4c.jpg) + +![Crkbd](https://user-images.githubusercontent.com/736191/40887871-0eead5dc-678a-11e8-9518-e3ad9e5d2bac.png) + +A split keyboard with 3x6 vertically staggered keys and 3 thumb keys. + +Keyboard Maintainer: [foostan](https://github.com/foostan/) [@foostan](https://twitter.com/foostan) +Hardware Supported: Crkbd PCB, Pro Micro +Hardware Availability: [PCB & Case Data](https://github.com/foostan/crkbd) + +Make example for this keyboard (after setting up your build environment): + +```sh +make crkbd:default +``` + +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). + +## Bootloader + +The Corne PCBs have a reset button next to the TRRS jack to enter in to the bootloader. + +Additionally, if you hold down the "Q" or "P" buttons when plugging in that half of the keyboard (per the default QWERTY layout), this will jump to the bootloader and reset the EEPROM (persistent storage). This would normally be the very top corner-most position, but due to the breakaway column, it's left at Q and P for compatibility. + +## RGB Matrix +The Corne Keyboard also supports using the RGB Matrix feature, in place of RGB Light. This provides a better experience when using the keyboard, as it supports a number of per key effects properly. If you're not using the in switch LEDs, then you may want to pass on doing this. + +In your keymap's `rules.mk` file, add the following: + +```make +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = yes +``` + +And in your `config.h` file, add the following: + +```c + +#ifdef RGB_MATRIX_ENABLE +# define RGB_MATRIX_KEYPRESSES // reacts to keypresses +// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses) +# define RGB_MATRIX_SLEEP // turn off effects when suspended +# define RGB_MATRIX_FRAMEBUFFER_EFFECTS +// # define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness) +// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness) +# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash. +# define RGB_MATRIX_HUE_STEP 8 +# define RGB_MATRIX_SAT_STEP 8 +# define RGB_MATRIX_VAL_STEP 8 +# define RGB_MATRIX_SPD_STEP 10 + +/* Enable the animations you want/need. You may need to enable only a small number of these because * + * they take up a lot of space. Enable and confirm that you can still successfully compile your firmware. */ +// RGB Matrix Animation modes. Explicitly enabled +// For full list of effects, see: +// https://docs.qmk.fm/#/feature_rgb_matrix?id=rgb-matrix-effects +# define ENABLE_RGB_MATRIX_ALPHAS_MODS +# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN +# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_BREATHING +# define ENABLE_RGB_MATRIX_BAND_SAT +# define ENABLE_RGB_MATRIX_BAND_VAL +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT +# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT +# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL +# define ENABLE_RGB_MATRIX_CYCLE_ALL +# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT +# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN +# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN +# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL +# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL +# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL +# define ENABLE_RGB_MATRIX_DUAL_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_BEACON +# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS +# define ENABLE_RGB_MATRIX_RAINDROPS +# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS +# define ENABLE_RGB_MATRIX_HUE_BREATHING +# define ENABLE_RGB_MATRIX_HUE_PENDULUM +# define ENABLE_RGB_MATRIX_HUE_WAVE +# define ENABLE_RGB_MATRIX_PIXEL_RAIN +# define ENABLE_RGB_MATRIX_PIXEL_FLOW +# define ENABLE_RGB_MATRIX_PIXEL_FRACTAL +// enabled only if RGB_MATRIX_FRAMEBUFFER_EFFECTS is defined +# define ENABLE_RGB_MATRIX_TYPING_HEATMAP +# define ENABLE_RGB_MATRIX_DIGITAL_RAIN +// enabled only of RGB_MATRIX_KEYPRESSES or RGB_MATRIX_KEYRELEASES is defined +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS +# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS +# define ENABLE_RGB_MATRIX_SPLASH +# define ENABLE_RGB_MATRIX_MULTISPLASH +# define ENABLE_RGB_MATRIX_SOLID_SPLASH +# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH +#endif +``` + +After this is done, you should be able to use the normal RGB keycodes, but you'll see the RGB Matrix effects in use, giving a much better experience. diff --git a/keyboards/crkbd/rev1/keyboard.json b/keyboards/crkbd/rev1/keyboard.json new file mode 100644 index 00000000000..4a4e07a5ddf --- /dev/null +++ b/keyboards/crkbd/rev1/keyboard.json @@ -0,0 +1,177 @@ +{ + "features": { + "rgblight": false + }, + "split": { + "serial": { + "pin": "B6" + } + }, + "ws2812": { + "pin": "D3" + }, + "rgb_matrix": { + "layout": [ + {"x": 85, "y": 16, "flags": 2}, + {"x": 50, "y": 13, "flags": 2}, + {"x": 16, "y": 20, "flags": 2}, + {"x": 16, "y": 38, "flags": 2}, + {"x": 50, "y": 48, "flags": 2}, + {"x": 85, "y": 52, "flags": 2}, + {"matrix": [3, 5], "x": 95, "y": 63, "flags": 1}, + {"matrix": [2, 5], "x": 85, "y": 39, "flags": 4}, + {"matrix": [1, 5], "x": 85, "y": 21, "flags": 4}, + {"matrix": [0, 5], "x": 85, "y": 4, "flags": 4}, + {"matrix": [0, 4], "x": 68, "y": 2, "flags": 4}, + {"matrix": [1, 4], "x": 68, "y": 19, "flags": 4}, + {"matrix": [2, 4], "x": 68, "y": 37, "flags": 4}, + {"matrix": [3, 4], "x": 80, "y": 58, "flags": 1}, + {"matrix": [3, 3], "x": 60, "y": 55, "flags": 1}, + {"matrix": [2, 3], "x": 50, "y": 35, "flags": 4}, + {"matrix": [1, 3], "x": 50, "y": 13, "flags": 4}, + {"matrix": [0, 3], "x": 50, "y": 0, "flags": 4}, + {"matrix": [0, 2], "x": 33, "y": 3, "flags": 4}, + {"matrix": [1, 2], "x": 33, "y": 20, "flags": 4}, + {"matrix": [2, 2], "x": 33, "y": 37, "flags": 4}, + {"matrix": [2, 1], "x": 16, "y": 42, "flags": 4}, + {"matrix": [1, 1], "x": 16, "y": 24, "flags": 4}, + {"matrix": [0, 1], "x": 16, "y": 7, "flags": 4}, + {"matrix": [0, 0], "x": 0, "y": 7, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 24, "flags": 1}, + {"matrix": [2, 0], "x": 0, "y": 41, "flags": 1}, + {"x": 139, "y": 16, "flags": 2}, + {"x": 174, "y": 13, "flags": 2}, + {"x": 208, "y": 20, "flags": 2}, + {"x": 208, "y": 38, "flags": 2}, + {"x": 174, "y": 48, "flags": 2}, + {"x": 139, "y": 52, "flags": 2}, + {"matrix": [7, 5], "x": 129, "y": 63, "flags": 1}, + {"matrix": [6, 5], "x": 139, "y": 39, "flags": 4}, + {"matrix": [5, 5], "x": 139, "y": 21, "flags": 4}, + {"matrix": [4, 5], "x": 139, "y": 4, "flags": 4}, + {"matrix": [4, 4], "x": 156, "y": 2, "flags": 4}, + {"matrix": [5, 4], "x": 156, "y": 19, "flags": 4}, + {"matrix": [6, 4], "x": 156, "y": 37, "flags": 4}, + {"matrix": [7, 4], "x": 144, "y": 58, "flags": 1}, + {"matrix": [7, 3], "x": 164, "y": 55, "flags": 1}, + {"matrix": [6, 3], "x": 174, "y": 35, "flags": 4}, + {"matrix": [5, 3], "x": 174, "y": 13, "flags": 4}, + {"matrix": [4, 3], "x": 174, "y": 0, "flags": 4}, + {"matrix": [4, 2], "x": 191, "y": 3, "flags": 4}, + {"matrix": [5, 2], "x": 191, "y": 20, "flags": 4}, + {"matrix": [6, 2], "x": 191, "y": 37, "flags": 4}, + {"matrix": [6, 1], "x": 208, "y": 42, "flags": 4}, + {"matrix": [5, 1], "x": 208, "y": 24, "flags": 4}, + {"matrix": [4, 1], "x": 208, "y": 7, "flags": 4}, + {"matrix": [4, 0], "x": 224, "y": 7, "flags": 1}, + {"matrix": [5, 0], "x": 224, "y": 24, "flags": 1}, + {"matrix": [6, 0], "x": 224, "y": 41, "flags": 1} + ] + }, + "development_board": "promicro", + "layout_aliases": { + "LAYOUT": "LAYOUT_split_3x6_3" + }, + "layouts": { + "LAYOUT_split_3x5_3": { + "layout": [ + {"matrix": [0, 1], "x": 0, "y": 0.3}, + {"matrix": [0, 2], "x": 1, "y": 0.1}, + {"matrix": [0, 3], "x": 2, "y": 0}, + {"matrix": [0, 4], "x": 3, "y": 0.1}, + {"matrix": [0, 5], "x": 4, "y": 0.2}, + + {"matrix": [4, 5], "x": 8, "y": 0.2}, + {"matrix": [4, 4], "x": 9, "y": 0.1}, + {"matrix": [4, 3], "x": 10, "y": 0}, + {"matrix": [4, 2], "x": 11, "y": 0.1}, + {"matrix": [4, 1], "x": 12, "y": 0.3}, + + {"matrix": [1, 1], "x": 0, "y": 1.3}, + {"matrix": [1, 2], "x": 1, "y": 1.1}, + {"matrix": [1, 3], "x": 2, "y": 1}, + {"matrix": [1, 4], "x": 3, "y": 1.1}, + {"matrix": [1, 5], "x": 4, "y": 1.2}, + + {"matrix": [5, 5], "x": 8, "y": 1.2}, + {"matrix": [5, 4], "x": 9, "y": 1.1}, + {"matrix": [5, 3], "x": 10, "y": 1}, + {"matrix": [5, 2], "x": 11, "y": 1.1}, + {"matrix": [5, 1], "x": 12, "y": 1.3}, + + {"matrix": [2, 1], "x": 0, "y": 2.3}, + {"matrix": [2, 2], "x": 1, "y": 2.1}, + {"matrix": [2, 3], "x": 2, "y": 2}, + {"matrix": [2, 4], "x": 3, "y": 2.1}, + {"matrix": [2, 5], "x": 4, "y": 2.2}, + + {"matrix": [6, 5], "x": 8, "y": 2.2}, + {"matrix": [6, 4], "x": 9, "y": 2.1}, + {"matrix": [6, 3], "x": 10, "y": 2}, + {"matrix": [6, 2], "x": 11, "y": 2.1}, + {"matrix": [6, 1], "x": 12, "y": 2.3}, + + {"matrix": [3, 3], "x": 3, "y": 3.7}, + {"matrix": [3, 4], "x": 4, "y": 3.7}, + {"matrix": [3, 5], "x": 5, "y": 3.2, "h": 1.5}, + + {"matrix": [7, 5], "x": 7, "y": 3.2, "h": 1.5}, + {"matrix": [7, 4], "x": 8, "y": 3.7}, + {"matrix": [7, 3], "x": 9, "y": 3.7} + ] + }, + "LAYOUT_split_3x6_3": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0.3}, + {"matrix": [0, 1], "x": 1, "y": 0.3}, + {"matrix": [0, 2], "x": 2, "y": 0.1}, + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [0, 4], "x": 4, "y": 0.1}, + {"matrix": [0, 5], "x": 5, "y": 0.2}, + + {"matrix": [4, 5], "x": 9, "y": 0.2}, + {"matrix": [4, 4], "x": 10, "y": 0.1}, + {"matrix": [4, 3], "x": 11, "y": 0}, + {"matrix": [4, 2], "x": 12, "y": 0.1}, + {"matrix": [4, 1], "x": 13, "y": 0.3}, + {"matrix": [4, 0], "x": 14, "y": 0.3}, + + {"matrix": [1, 0], "x": 0, "y": 1.3}, + {"matrix": [1, 1], "x": 1, "y": 1.3}, + {"matrix": [1, 2], "x": 2, "y": 1.1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [1, 4], "x": 4, "y": 1.1}, + {"matrix": [1, 5], "x": 5, "y": 1.2}, + + {"matrix": [5, 5], "x": 9, "y": 1.2}, + {"matrix": [5, 4], "x": 10, "y": 1.1}, + {"matrix": [5, 3], "x": 11, "y": 1}, + {"matrix": [5, 2], "x": 12, "y": 1.1}, + {"matrix": [5, 1], "x": 13, "y": 1.3}, + {"matrix": [5, 0], "x": 14, "y": 1.3}, + + {"matrix": [2, 0], "x": 0, "y": 2.3}, + {"matrix": [2, 1], "x": 1, "y": 2.3}, + {"matrix": [2, 2], "x": 2, "y": 2.1}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [2, 4], "x": 4, "y": 2.1}, + {"matrix": [2, 5], "x": 5, "y": 2.2}, + + {"matrix": [6, 5], "x": 9, "y": 2.2}, + {"matrix": [6, 4], "x": 10, "y": 2.1}, + {"matrix": [6, 3], "x": 11, "y": 2}, + {"matrix": [6, 2], "x": 12, "y": 2.1}, + {"matrix": [6, 1], "x": 13, "y": 2.3}, + {"matrix": [6, 0], "x": 14, "y": 2.3}, + + {"matrix": [3, 3], "x": 4, "y": 3.7}, + {"matrix": [3, 4], "x": 5, "y": 3.7}, + {"matrix": [3, 5], "x": 6, "y": 3.2, "h": 1.5}, + + {"matrix": [7, 5], "x": 8, "y": 3.2, "h": 1.5}, + {"matrix": [7, 4], "x": 9, "y": 3.7}, + {"matrix": [7, 3], "x": 10, "y": 3.7} + ] + } + } +} diff --git a/keyboards/crkbd/rev1/keymaps/spuxy/config.h b/keyboards/crkbd/rev1/keymaps/spuxy/config.h new file mode 100644 index 00000000000..22d61b2b8fc --- /dev/null +++ b/keyboards/crkbd/rev1/keymaps/spuxy/config.h @@ -0,0 +1,45 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 USE_MATRIX_I2C + +//#define QUICK_TAP_TERM 0 +//#define TAPPING_TERM 100 + +#define MASTER_LEFT +#define SPLIT_USB_DETECT +#ifdef RGBLIGHT_ENABLE + #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 + #define RGBLIGHT_LIMIT_VAL 120 + #define RGBLIGHT_HUE_STEP 10 + #define RGBLIGHT_SAT_STEP 17 + #define RGBLIGHT_VAL_STEP 17 +#endif diff --git a/keyboards/crkbd/rev1/keymaps/spuxy/keymap.c b/keyboards/crkbd/rev1/keymaps/spuxy/keymap.c new file mode 100644 index 00000000000..5d1cebd3616 --- /dev/null +++ b/keyboards/crkbd/rev1/keymaps/spuxy/keymap.c @@ -0,0 +1,23 @@ +#include QMK_KEYBOARD_H +#if __has_include("keymap.h") +# include "keymap.h" +#endif + + +/* THIS FILE WAS GENERATED! + * + * This file was generated by qmk json2c. You may or may not want to + * edit it directly. + */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_split_3x6_3(KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ESC, KC_LGUI, MO(1), KC_SPC, KC_ENT, MO(2), KC_RALT), + [1] = LAYOUT_split_3x6_3(KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, KC_NO, KC_LSFT, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LGUI, KC_TRNS, KC_SPC, KC_ENT, MO(3), KC_RALT), + [2] = LAYOUT_split_3x6_3(KC_TAB, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_LCTL, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, KC_TILD, KC_LGUI, MO(3), KC_SPC, KC_ENT, KC_TRNS, KC_RALT), + [3] = LAYOUT_split_3x6_3(QK_BOOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LGUI, KC_TRNS, KC_SPC, KC_ENT, KC_TRNS, KC_RALT) +}; + +#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + +}; +#endif // defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) diff --git a/keyboards/crkbd/rules.mk b/keyboards/crkbd/rules.mk new file mode 100644 index 00000000000..b74bf6fd00c --- /dev/null +++ b/keyboards/crkbd/rules.mk @@ -0,0 +1,2 @@ +DEFAULT_FOLDER = crkbd/rev1 +CONVERT_TO=promicro_rp2040 diff --git a/qmk.json b/qmk.json index 3afc389f424..edc266d742f 100644 --- a/qmk.json +++ b/qmk.json @@ -1,4 +1,7 @@ { - "userspace_version": "1.0", - "build_targets": [] -} \ No newline at end of file + "userspace_version": "1.1", + "build_targets": [ + ["crkbd/rev1", "default"], + ["crkbd/rev1", "spuxy"] + ] +}