Add Lemokey X0 keyboard (#24994)

This commit is contained in:
Aidan Gauland 2025-04-26 12:31:25 +12:00 committed by GitHub
parent 12d70ab1a4
commit 3319474c5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 360 additions and 0 deletions

View File

@ -0,0 +1,8 @@
// Copyright 2023 @ Keychron(https://www.keychron.com)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include_next <board.h>
#undef STM32_HSECLK
#define STM32_HSECLK 16000000U

View File

@ -0,0 +1,23 @@
/* 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
/* I2C Driver Configuration */
#define I2C1_SCL_PIN B8
#define I2C1_SDA_PIN B9
#define I2C1_CLOCK_SPEED 400000
#define I2C1_DUTY_CYCLE FAST_DUTY_CYCLE_2

View File

@ -0,0 +1,21 @@
/* Copyright 2020 QMK
*
* 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
#define HAL_USE_I2C TRUE
#include_next <halconf.h>

View File

@ -0,0 +1,73 @@
{
"manufacturer": "Keychron",
"keyboard_name": "Lemokey X0",
"maintainer": "lalalademaxiya1",
"bootloader": "stm32-dfu",
"diode_direction": "COL2ROW",
"eeprom": {
"wear_leveling": {
"backing_size": 4096
}
},
"features": {
"bootmagic": true,
"extrakey": true,
"mousekey": true,
"nkro": true
},
"indicators": {
"caps_lock": "A3"
},
"matrix_pins": {
"cols": ["C6", "C7", "C8", "A14", "A15", "C10", "C11"],
"rows": ["C12", "D2", "B3", "B4", "B5", "B6"]
},
"processor": "STM32F401",
"url": "https://www.lemokey.com/products/lemokey-x0-qmk-wired-mechanical-gaming-keypad",
"usb": {
"device_version": "1.1.0",
"pid": "0x0200",
"vid": "0x362D"
},
"layouts": {
"LAYOUT": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 2, "y": 0},
{"matrix": [0, 2], "x": 3, "y": 0},
{"matrix": [0, 3], "x": 4, "y": 0},
{"matrix": [0, 4], "x": 5, "y": 0},
{"matrix": [0, 5], "x": 6, "y": 0},
{"matrix": [1, 0], "x": 0, "y": 1.25},
{"matrix": [1, 1], "x": 1, "y": 1.25},
{"matrix": [1, 2], "x": 2, "y": 1.25},
{"matrix": [1, 3], "x": 3, "y": 1.25},
{"matrix": [1, 4], "x": 4, "y": 1.25},
{"matrix": [1, 5], "x": 5, "y": 1.25},
{"matrix": [1, 6], "x": 6, "y": 1.25},
{"matrix": [2, 0], "x": 0, "y": 2.25, "w": 1.5},
{"matrix": [2, 1], "x": 1.5, "y": 2.25},
{"matrix": [2, 2], "x": 2.5, "y": 2.25},
{"matrix": [2, 3], "x": 3.5, "y": 2.25},
{"matrix": [2, 4], "x": 4.5, "y": 2.25},
{"matrix": [2, 5], "x": 5.5, "y": 2.25, "w": 1.5},
{"matrix": [3, 0], "x": 0, "y": 3.25, "w": 1.75},
{"matrix": [3, 1], "x": 1.75, "y": 3.25},
{"matrix": [3, 2], "x": 2.75, "y": 3.25},
{"matrix": [3, 3], "x": 3.75, "y": 3.25},
{"matrix": [3, 4], "x": 4.75, "y": 3.25},
{"matrix": [3, 5], "x": 5.75, "y": 3.25, "w": 1.25},
{"matrix": [4, 0], "x": 0, "y": 4.25, "w": 2.25},
{"matrix": [4, 2], "x": 2.25, "y": 4.25},
{"matrix": [4, 3], "x": 3.25, "y": 4.25},
{"matrix": [4, 4], "x": 4.25, "y": 4.25},
{"matrix": [4, 5], "x": 5.25, "y": 4.25, "w": 1.75},
{"matrix": [5, 0], "x": 0, "y": 5.25, "w": 1.5},
{"matrix": [5, 2], "x": 2.75, "y": 5.25},
{"matrix": [5, 3], "x": 3.75, "y": 5.25},
{"matrix": [5, 4], "x": 4.75, "y": 5.25},
{"matrix": [5, 5], "x": 6, "y": 5.25}
]
}
}
}

View File

@ -0,0 +1,25 @@
/* Copyright 2020 QMK
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include_next <mcuconf.h>
#undef STM32_PLLM_VALUE
#define STM32_PLLM_VALUE 8
#undef STM32_I2C_USE_I2C1
#define STM32_I2C_USE_I2C1 TRUE

View File

@ -0,0 +1,23 @@
# Lemokey X0
![Lemokey X0](https://i.imgur.com/ntROq41.jpeg)
A one-handed gaming keypad.
* Keyboard Maintainer: [Keychron](https://github.com/keychron)
* Hardware Supported: Lemokey X0
* Hardware Availability: [Keychron](https://www.lemokey.com/products/lemokey-x0-qmk-wired-mechanical-gaming-keypad)
Make example for this keyboard (after setting up your build environment):
make keychron/x0/red:default
Flashing example for this keyboard:
make keychron/x0/red: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).
## Bootloader
To enter the bootloader, hold down the key located at **K00**, labelled and commonly programmed as **Esc**, while plugging in the keyboard.

View File

@ -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

View File

@ -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
}
}

View File

@ -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,
_______, _______, _______, _______, _______),
};

View File

@ -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