diff options
Diffstat (limited to 'keyboards/keychron/x0/red')
-rw-r--r-- | keyboards/keychron/x0/red/config.h | 25 | ||||
-rw-r--r-- | keyboards/keychron/x0/red/keyboard.json | 60 | ||||
-rw-r--r-- | keyboards/keychron/x0/red/keymaps/default/keymap.c | 41 | ||||
-rw-r--r-- | keyboards/keychron/x0/red/red.c | 61 |
4 files changed, 187 insertions, 0 deletions
diff --git a/keyboards/keychron/x0/red/config.h b/keyboards/keychron/x0/red/config.h new file mode 100644 index 0000000000..067266830f --- /dev/null +++ b/keyboards/keychron/x0/red/config.h @@ -0,0 +1,25 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#ifdef LED_MATRIX_ENABLE +# define SNLED27351_I2C_ADDRESS_1 SNLED27351_I2C_ADDRESS_GND + +# define SNLED27351_PHASE_CHANNEL SNLED27351_SCAN_PHASE_6_CHANNEL +# define SNLED27351_CURRENT_TUNE \ + { 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60 } +#endif diff --git a/keyboards/keychron/x0/red/keyboard.json b/keyboards/keychron/x0/red/keyboard.json new file mode 100644 index 0000000000..f591a607eb --- /dev/null +++ b/keyboards/keychron/x0/red/keyboard.json @@ -0,0 +1,60 @@ +{ + "features": { + "led_matrix": true + }, + "led_matrix": { + "animations": { + "band_pinwheel": true, + "band_spiral": true, + "breathing": true, + "cycle_left_right": true, + "cycle_out_in": true, + "cycle_up_down": true, + "dual_beacon": true, + "solid_reactive_multinexus": true, + "solid_reactive_multiwide": true, + "solid_reactive_simple": true, + "solid_splash": true, + "wave_left_right": true, + "wave_up_down": true + }, + "driver": "snled27351", + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "flags": 1}, + {"matrix": [0, 1], "x": 37, "y": 0, "flags": 1}, + {"matrix": [0, 2], "x": 75, "y": 0, "flags": 1}, + {"matrix": [0, 3], "x": 112, "y": 0, "flags": 1}, + {"matrix": [0, 4], "x": 149, "y": 0, "flags": 1}, + {"matrix": [0, 5], "x": 187, "y": 0, "flags": 1}, + {"matrix": [1, 0], "x": 0, "y": 13, "flags": 1}, + {"matrix": [1, 1], "x": 37, "y": 13, "flags": 4}, + {"matrix": [1, 2], "x": 75, "y": 13, "flags": 4}, + {"matrix": [1, 3], "x": 112, "y": 13, "flags": 4}, + {"matrix": [1, 4], "x": 149, "y": 13, "flags": 4}, + {"matrix": [1, 5], "x": 187, "y": 13, "flags": 4}, + {"matrix": [1, 6], "x": 224, "y": 13, "flags": 4}, + {"matrix": [2, 0], "x": 0, "y": 26, "flags": 1}, + {"matrix": [2, 1], "x": 37, "y": 26, "flags": 4}, + {"matrix": [2, 2], "x": 75, "y": 26, "flags": 4}, + {"matrix": [2, 3], "x": 112, "y": 26, "flags": 4}, + {"matrix": [2, 4], "x": 149, "y": 26, "flags": 4}, + {"matrix": [2, 5], "x": 187, "y": 26, "flags": 4}, + {"matrix": [3, 0], "x": 0, "y": 38, "flags": 1}, + {"matrix": [3, 1], "x": 37, "y": 38, "flags": 4}, + {"matrix": [3, 2], "x": 75, "y": 38, "flags": 4}, + {"matrix": [3, 3], "x": 112, "y": 38, "flags": 4}, + {"matrix": [3, 4], "x": 149, "y": 38, "flags": 4}, + {"matrix": [3, 5], "x": 187, "y": 38, "flags": 4}, + {"matrix": [4, 0], "x": 0, "y": 51, "flags": 1}, + {"matrix": [4, 2], "x": 75, "y": 51, "flags": 4}, + {"matrix": [4, 3], "x": 112, "y": 51, "flags": 4}, + {"matrix": [4, 4], "x": 149, "y": 51, "flags": 4}, + {"matrix": [4, 5], "x": 187, "y": 51, "flags": 4}, + {"matrix": [5, 0], "x": 0, "y": 64, "flags": 1}, + {"matrix": [5, 2], "x": 75, "y": 64, "flags": 1}, + {"matrix": [5, 3], "x": 112, "y": 64, "flags": 1}, + {"matrix": [5, 4], "x": 149, "y": 64, "flags": 1} + ], + "sleep": true + } +} diff --git a/keyboards/keychron/x0/red/keymaps/default/keymap.c b/keyboards/keychron/x0/red/keymaps/default/keymap.c new file mode 100644 index 0000000000..4d04c09d9b --- /dev/null +++ b/keyboards/keychron/x0/red/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include QMK_KEYBOARD_H + +enum layers { + WIN_BASE, + WIN_FN, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [WIN_BASE] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, + KC_LCTL, KC_LALT, MO(WIN_FN), MO(WIN_FN), KC_SPC), + + [WIN_FN] = LAYOUT( + _______, KC_BRID, KC_BRIU, LGUI(KC_TAB), LGUI(KC_E), _______, + _______, _______, _______, _______, _______, _______, _______, + LM_TOGG, LM_PREV, LM_BRIU, LM_NEXT, _______, _______, + _______, LM_SPDD, LM_BRID, LM_SPDU, _______, _______, + _______, _______, _______, _______, NK_TOGG, + _______, _______, _______, _______, _______), +}; diff --git a/keyboards/keychron/x0/red/red.c b/keyboards/keychron/x0/red/red.c new file mode 100644 index 0000000000..9499a09d8b --- /dev/null +++ b/keyboards/keychron/x0/red/red.c @@ -0,0 +1,61 @@ +/* Copyright 2023 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "quantum.h" + +#ifdef LED_MATRIX_ENABLE +// clang-format off +const snled27351_led_t PROGMEM g_snled27351_leds[LED_MATRIX_LED_COUNT] = { +/* Refer to SNLED27351 manual for these locations + * driver + * | LED address + * | | */ + {0, CB6_CA1 }, + {0, CB6_CA2 }, + {0, CB6_CA3 }, + {0, CB6_CA4 }, + {0, CB6_CA5 }, + {0, CB6_CA6 }, + {0, CB5_CA1 }, + {0, CB5_CA2 }, + {0, CB5_CA3 }, + {0, CB5_CA4 }, + {0, CB5_CA5 }, + {0, CB5_CA6 }, + {0, CB5_CA7 }, + {0, CB4_CA1 }, + {0, CB4_CA2 }, + {0, CB4_CA3 }, + {0, CB4_CA4 }, + {0, CB4_CA5 }, + {0, CB4_CA6 }, + {0, CB3_CA1 }, + {0, CB3_CA2 }, + {0, CB3_CA3 }, + {0, CB3_CA4 }, + {0, CB3_CA5 }, + {0, CB3_CA6 }, + {0, CB2_CA1 }, + {0, CB2_CA3 }, + {0, CB2_CA4 }, + {0, CB2_CA5 }, + {0, CB2_CA6 }, + {0, CB1_CA1 }, + {0, CB1_CA3 }, + {0, CB1_CA4 }, + {0, CB1_CA5 }, +}; +#endif |