mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-21 19:09:25 +00:00
Compare commits
72 Commits
0207b6797e
...
10c43afe54
Author | SHA1 | Date | |
---|---|---|---|
|
10c43afe54 | ||
|
9bea332a21 | ||
|
8cbcdcac62 | ||
|
a108945225 | ||
|
70ae2a1992 | ||
|
3582988566 | ||
|
fa3d2624eb | ||
|
4ee8e0d365 | ||
|
350f7ca28b | ||
|
36f48052b2 | ||
|
baa16d8296 | ||
|
f3e7a3dc8c | ||
|
fb0e1acb58 | ||
|
cf1e065508 | ||
|
238ebd96bc | ||
|
2871af5316 | ||
|
e57a83250d | ||
|
5de9a8e78f | ||
|
d06f16d756 | ||
|
bb046d95a9 | ||
|
18ea74f588 | ||
|
634412e69c | ||
|
7212e61254 | ||
|
83b72a7ca3 | ||
|
c80997351b | ||
|
d279d83f26 | ||
|
f29b64fffe | ||
|
b157de1fcb | ||
|
760b5d46a7 | ||
|
2cd09a0367 | ||
|
0038afa756 | ||
|
63d3494f9f | ||
|
1a88922abe | ||
|
af89dcc72f | ||
|
108e3d2b5c | ||
|
abfd6bf92d | ||
|
26933be1f7 | ||
|
cb8a1caed0 | ||
|
718c9d6e9a | ||
|
66675adec3 | ||
|
0965537997 | ||
|
bda78887a6 | ||
|
11a099f3f4 | ||
|
2daac2ab14 | ||
|
6d6226952e | ||
|
84ab499c73 | ||
|
0435cc7ba4 | ||
|
dbe4c1b1c6 | ||
|
76a2d9dbc2 | ||
|
e696340e93 | ||
|
63c862754d | ||
|
25e3dda81a | ||
|
07e15d2d73 | ||
|
c9f6531131 | ||
|
03c64af184 | ||
|
fe5ca2c3e3 | ||
|
70c7e10bb0 | ||
|
7a82636d38 | ||
|
b8295041d9 | ||
|
4ad729f63a | ||
|
87b764f03f | ||
|
86b36aee8e | ||
|
0e1dd850ee | ||
|
4b11b8220b | ||
|
bada9b59fe | ||
|
0ff5d3dfe3 | ||
|
48354685d4 | ||
|
23d1a538e1 | ||
|
d60c64f8f0 | ||
|
04e6ace84b | ||
|
d093e2b30b | ||
|
21899b306c |
124
keyboards/mmd/common/smart_ble.c
Normal file
124
keyboards/mmd/common/smart_ble.c
Normal file
@ -0,0 +1,124 @@
|
||||
// /* Copyright 2024 Jacky
|
||||
// *
|
||||
// * 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 "uart.h"
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
#include "host.h"
|
||||
#include "host_driver.h"
|
||||
#include "report.h"
|
||||
#include "smart_ble.h"
|
||||
|
||||
static uint8_t sc_ble_leds(void) {
|
||||
return 0; // TODO: Get LED status BLE
|
||||
}
|
||||
|
||||
static void sc_ble_mouse(report_mouse_t *report) {
|
||||
static uint8_t last_report[sizeof(report_mouse_t)]={0};
|
||||
|
||||
if (!has_mouse_report_changed((report_mouse_t *)last_report, report)) return;
|
||||
memcpy(last_report,report,sizeof(report_mouse_t));
|
||||
uart_write(0x55);
|
||||
uart_write(sizeof(report_mouse_t));
|
||||
uart_transmit(last_report,sizeof(report_mouse_t));
|
||||
}
|
||||
|
||||
|
||||
static void sc_ble_extra(report_extra_t *report) {
|
||||
uart_write(0x55);
|
||||
uart_write(sizeof(report_extra_t));
|
||||
uart_transmit((uint8_t *)report,sizeof(report_extra_t));
|
||||
}
|
||||
|
||||
static void sc_ble_keyboard(report_keyboard_t *report) {
|
||||
uart_write(0x55);
|
||||
uart_write(0x09);
|
||||
uart_write(0x01);
|
||||
uart_transmit((uint8_t *)report,KEYBOARD_REPORT_SIZE);
|
||||
}
|
||||
|
||||
static void sc_send_nkro(report_nkro_t *report)
|
||||
{
|
||||
uart_write(0x55);
|
||||
uart_write(0x12);
|
||||
uart_transmit((uint8_t *)report,0x12);
|
||||
}
|
||||
|
||||
static host_driver_t *last_host_driver = NULL;
|
||||
static host_driver_t sc_ble_driver = {
|
||||
sc_ble_leds, sc_ble_keyboard,sc_send_nkro,sc_ble_mouse, sc_ble_extra
|
||||
};
|
||||
|
||||
|
||||
void smart_ble_startup(void) {
|
||||
if (host_get_driver() == &sc_ble_driver) {
|
||||
return;
|
||||
}
|
||||
clear_keyboard();
|
||||
last_host_driver = host_get_driver();
|
||||
host_set_driver(&sc_ble_driver);
|
||||
}
|
||||
|
||||
void smart_ble_disconnect(void) {
|
||||
if (host_get_driver() != &sc_ble_driver) {
|
||||
return;
|
||||
}
|
||||
clear_keyboard();
|
||||
host_set_driver(last_host_driver);
|
||||
}
|
||||
|
||||
|
||||
void sc_ble_battary(uint8_t batt_level) {
|
||||
uart_write(0x55);
|
||||
uart_write(0x02);
|
||||
uart_write(0x09);
|
||||
uart_write(batt_level);
|
||||
}
|
||||
|
||||
void WIRELESS_START(uint32_t mode)
|
||||
{
|
||||
uint8_t ble_command[24];
|
||||
smart_ble_startup();
|
||||
if(mode<1 || mode>4)
|
||||
{
|
||||
mode=1;
|
||||
}
|
||||
ble_command[0]=0x55;
|
||||
ble_command[1]=20;
|
||||
ble_command[2]=0;
|
||||
ble_command[3]=mode;
|
||||
strcpy((char * restrict)(ble_command+4),PRODUCT);
|
||||
ble_command[strlen(PRODUCT)+4]='-';
|
||||
ble_command[strlen(PRODUCT)+5]='0' + mode;
|
||||
ble_command[strlen(PRODUCT)+6]= 0;
|
||||
uart_transmit(ble_command,sizeof(ble_command));
|
||||
}
|
||||
|
||||
void WIRELESS_STOP(void)
|
||||
{
|
||||
smart_ble_disconnect();
|
||||
uart_write(0x55);
|
||||
uart_write(0x02);
|
||||
uart_write(0x00);
|
||||
uart_write(0x00);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
32
keyboards/mmd/common/smart_ble.h
Normal file
32
keyboards/mmd/common/smart_ble.h
Normal file
@ -0,0 +1,32 @@
|
||||
// /* Copyright 2024 Jacky
|
||||
// *
|
||||
// * 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 "quantum.h"
|
||||
|
||||
void sc_ble_battary(uint8_t batt_level);
|
||||
void WIRELESS_START(uint32_t mode);
|
||||
void WIRELESS_STOP(void);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
25
keyboards/mmd/km75/config.h
Normal file
25
keyboards/mmd/km75/config.h
Normal file
@ -0,0 +1,25 @@
|
||||
/* Copyright 2022 Jacky
|
||||
*
|
||||
* 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 WS2812_PWM_DRIVER PWMD3
|
||||
#define WS2812_PWM_CHANNEL 1
|
||||
#define WS2812_PWM_PAL_MODE 2
|
||||
#define WS2812_DMA_STREAM STM32_DMA1_STREAM3
|
||||
#define WS2812_DMA_CHANNEL 3
|
||||
|
22
keyboards/mmd/km75/halconf.h
Normal file
22
keyboards/mmd/km75/halconf.h
Normal file
@ -0,0 +1,22 @@
|
||||
/* Copyright 2022 Jacky
|
||||
*
|
||||
* 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_PWM TRUE
|
||||
|
||||
#include_next <halconf.h>
|
261
keyboards/mmd/km75/keyboard.json
Normal file
261
keyboards/mmd/km75/keyboard.json
Normal file
@ -0,0 +1,261 @@
|
||||
{
|
||||
"manufacturer": "MMD",
|
||||
"keyboard_name": "MMD-KM75",
|
||||
"maintainer": "Smartmmd",
|
||||
"bootloader": "stm32duino",
|
||||
"diode_direction": "ROW2COL",
|
||||
"encoder": {
|
||||
"rotary": [
|
||||
{"pin_a": "B3", "pin_b": "A7", "resolution": 2}
|
||||
]
|
||||
},
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"console": true,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
"rgb_matrix": true,
|
||||
"encoder": true
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["B0", "C15", "C14", "C13", "A15", "B7", "B6", "B5", "B4", "B12", "B13", "B14", "A14", "B2", "B15"],
|
||||
"rows": ["A0", "A1", "A2", "A3", "A4", "A5"]
|
||||
},
|
||||
"processor": "STM32F103",
|
||||
"rgb_matrix": {
|
||||
"animations": {
|
||||
"gradient_up_down": true,
|
||||
"gradient_left_right": true,
|
||||
"breathing": true,
|
||||
"band_sat": true,
|
||||
"band_val": true,
|
||||
"band_pinwheel_sat": true,
|
||||
"band_pinwheel_val": true,
|
||||
"band_spiral_sat": true,
|
||||
"band_spiral_val": true,
|
||||
"cycle_all": true,
|
||||
"cycle_left_right": true,
|
||||
"cycle_up_down": true,
|
||||
"cycle_out_in": true,
|
||||
"cycle_out_in_dual": true,
|
||||
"rainbow_moving_chevron": true,
|
||||
"cycle_pinwheel": true,
|
||||
"cycle_spiral": true,
|
||||
"dual_beacon": true,
|
||||
"rainbow_beacon": true,
|
||||
"rainbow_pinwheels": true,
|
||||
"hue_breathing": true,
|
||||
"hue_pendulum": true,
|
||||
"hue_wave": true,
|
||||
"typing_heatmap": true,
|
||||
"digital_rain": true,
|
||||
"solid_reactive_simple": true,
|
||||
"solid_reactive": true,
|
||||
"solid_reactive_wide": true,
|
||||
"solid_reactive_multiwide": true,
|
||||
"solid_reactive_cross": true,
|
||||
"solid_reactive_multicross": true,
|
||||
"solid_reactive_nexus": true,
|
||||
"solid_reactive_multinexus": true,
|
||||
"splash": true,
|
||||
"multisplash": true,
|
||||
"solid_splash": true,
|
||||
"solid_multisplash": true
|
||||
},
|
||||
"driver": "ws2812",
|
||||
"layout": [
|
||||
{ "flags": 4, "matrix": [5, 5], "x": 93, "y": 64 },
|
||||
{ "flags": 4, "matrix": [5, 10], "x": 150, "y": 64 },
|
||||
{ "flags": 4, "matrix": [5, 11], "x": 169, "y": 64 },
|
||||
{ "flags": 4, "matrix": [5, 12], "x": 194, "y": 64 },
|
||||
{ "flags": 4, "matrix": [5, 13], "x": 209, "y": 64 },
|
||||
{ "flags": 4, "matrix": [5, 14], "x": 224, "y": 64 },
|
||||
|
||||
{ "flags": 4, "matrix": [4, 14], "x": 224, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 13], "x": 213, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 12], "x": 192, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 11], "x": 172, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 10], "x": 156, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 9], "x": 141, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 8], "x": 126, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 7], "x": 111, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 6], "x": 95, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 5], "x": 80, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 4], "x": 65, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 3], "x": 50, "y": 52 },
|
||||
{ "flags": 4, "matrix": [4, 2], "x": 34, "y": 52 },
|
||||
|
||||
{ "flags": 4, "matrix": [5, 2], "x": 40, "y": 64 },
|
||||
{ "flags": 4, "matrix": [5, 1], "x": 21, "y": 64 },
|
||||
{ "flags": 4, "matrix": [5, 0], "x": 2, "y": 64 },
|
||||
{ "flags": 4, "matrix": [4, 0], "x": 10, "y": 52 },
|
||||
|
||||
{ "flags": 4, "matrix": [3, 0], "x": 1, "y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 1], "x": 22, "y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 2], "x": 37, "y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 3], "x": 52, "y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 4], "x": 68, "y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 5], "x": 83, "y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 6], "x": 98, "y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 7], "x": 113,"y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 8], "x": 129,"y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 9], "x": 144,"y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 10], "x": 159,"y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 11], "x": 174,"y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 13], "x": 199,"y": 40 },
|
||||
{ "flags": 4, "matrix": [3, 14], "x": 224,"y": 40 },
|
||||
|
||||
{ "flags": 4, "matrix": [2, 14], "x": 224, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 13], "x": 209, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 12], "x": 190, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 11], "x": 175, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 10], "x": 160, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 9], "x": 145, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 8], "x": 129, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 7], "x": 114, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 6], "x": 99, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 5], "x": 84, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 4], "x": 69, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 3], "x": 53, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 2], "x": 38, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 1], "x": 23, "y": 28 },
|
||||
{ "flags": 4, "matrix": [2, 0], "x": 4, "y": 28 },
|
||||
|
||||
{ "flags": 4, "matrix": [1, 0], "x": 0, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 1], "x": 11, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 2], "x": 26, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 3], "x": 41, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 4], "x": 56, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 5], "x": 72, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 6], "x": 87, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 7], "x": 102, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 8], "x": 117, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 9], "x": 133, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 10], "x": 148, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 11], "x": 163, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 12], "x": 178, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 13], "x": 201, "y": 15 },
|
||||
{ "flags": 4, "matrix": [1, 14], "x": 224, "y": 15 },
|
||||
|
||||
{ "flags": 4, "matrix": [0, 13], "x": 213, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 12], "x": 194, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 11], "x": 179, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 10], "x": 164, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 9], "x": 149, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 8], "x": 129, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 7], "x": 114, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 6], "x": 99, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 5], "x": 84, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 4], "x": 65, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 3], "x": 50, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 2], "x": 34, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 1], "x": 19, "y": 0 },
|
||||
{ "flags": 4, "matrix": [0, 0], "x": 0, "y": 0 }
|
||||
]
|
||||
},
|
||||
"url": "www.i-chip.cn",
|
||||
"usb": {
|
||||
"device_version": "0.0.1",
|
||||
"force_nkro": true,
|
||||
"pid": "0x3021",
|
||||
"vid": "0x28E9"
|
||||
},
|
||||
"ws2812": {
|
||||
"driver": "pwm",
|
||||
"pin": "A6"
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"matrix":[0, 0],"x": 0,"y": 0},
|
||||
{"matrix":[0, 1],"x": 1.25,"y": 0},
|
||||
{"matrix":[0, 2],"x": 2.25, "y": 0},
|
||||
{"matrix":[0, 3],"x": 3.25, "y": 0},
|
||||
{"matrix":[0, 4],"x": 4.25, "y": 0},
|
||||
{"matrix":[0, 5],"x": 5.5, "y": 0},
|
||||
{"matrix":[0, 6],"x": 6.5, "y": 0},
|
||||
{"matrix":[0, 7],"x": 7.5, "y": 0},
|
||||
{"matrix":[0, 8],"x": 8.5, "y": 0},
|
||||
{"matrix":[0, 9],"x": 9.75, "y": 0},
|
||||
{"matrix":[0, 10],"x": 10.75, "y": 0},
|
||||
{"matrix":[0, 11],"x": 11.75, "y": 0},
|
||||
{"matrix":[0, 12],"x": 12.75, "y": 0},
|
||||
{"matrix":[0, 13],"x": 14, "y": 0},
|
||||
{"matrix":[0, 14],"x": 15, "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":[1, 7],"x": 7, "y": 1.25},
|
||||
{"matrix":[1, 8],"x": 8, "y": 1.25},
|
||||
{"matrix":[1, 9],"x": 9, "y": 1.25},
|
||||
{"matrix":[1, 10],"x": 10, "y": 1.25},
|
||||
{"matrix":[1, 11],"x": 11, "y": 1.25},
|
||||
{"matrix":[1, 12],"x": 12, "y": 1.25},
|
||||
{"matrix":[1, 13],"x": 13, "y": 1.25,"w":2},
|
||||
{"matrix":[1, 14],"x": 15, "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},
|
||||
{"matrix":[2, 6],"x": 6.5, "y": 2.25},
|
||||
{"matrix":[2, 7],"x": 7.5, "y": 2.25},
|
||||
{"matrix":[2, 8],"x": 8.5, "y": 2.25},
|
||||
{"matrix":[2, 9],"x": 9.5, "y": 2.25},
|
||||
{"matrix":[2, 10],"x": 10.5, "y": 2.25},
|
||||
{"matrix":[2, 11],"x": 11.5, "y": 2.25},
|
||||
{"matrix":[2, 12],"x": 12.5, "y": 2.25},
|
||||
{"matrix":[2, 13],"x": 13.5, "y": 2.25,"w":1.5},
|
||||
{"matrix":[2, 14],"x": 15, "y": 2.25},
|
||||
|
||||
{"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},
|
||||
{"matrix":[3, 6],"x": 6.75, "y": 3.25},
|
||||
{"matrix":[3, 7],"x": 7.75, "y": 3.25},
|
||||
{"matrix":[3, 8],"x": 8.75, "y": 3.25},
|
||||
{"matrix":[3, 9],"x": 9.75, "y": 3.25},
|
||||
{"matrix":[3, 10],"x": 10.75, "y": 3.25},
|
||||
{"matrix":[3, 11],"x": 11.75, "y": 3.25},
|
||||
{"matrix":[3, 13],"x": 12.75, "y": 3.25,"w":2.25},
|
||||
{"matrix":[3, 14],"x": 15, "y": 3.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},
|
||||
{"matrix":[4, 6],"x": 6.25, "y": 4.25},
|
||||
{"matrix":[4, 7],"x": 7.25, "y": 4.25},
|
||||
{"matrix":[4, 8],"x": 8.25, "y": 4.25},
|
||||
{"matrix":[4, 9],"x": 9.25, "y": 4.25},
|
||||
{"matrix":[4, 10],"x": 10.25, "y": 4.25},
|
||||
{"matrix":[4, 11],"x": 11.25, "y": 4.25},
|
||||
{"matrix":[4, 12],"x": 12.25, "y": 4.25,"w":1.75},
|
||||
{"matrix":[4, 13],"x": 14, "y": 4.25},
|
||||
{"matrix":[4, 14],"x": 15, "y": 4.25},
|
||||
|
||||
{"matrix":[5, 0],"x": 0, "y": 5.25,"w":1.25},
|
||||
{"matrix":[5, 1],"x": 1.25, "y": 5.25,"w":1.25},
|
||||
{"matrix":[5, 2],"x": 2.5, "y": 5.25,"w":1.25},
|
||||
{"matrix":[5, 5],"x": 3.75, "y": 5.25,"w":6.25},
|
||||
{"matrix":[5, 10],"x": 10, "y": 5.25,"w":1.25},
|
||||
{"matrix":[5, 11],"x": 11.25, "y": 5.25,"w":1.25},
|
||||
{"matrix":[5, 12],"x": 13, "y": 5.25},
|
||||
{"matrix":[5, 13],"x": 14, "y": 5.25},
|
||||
{"matrix":[5, 14],"x": 15, "y": 5.25}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
38
keyboards/mmd/km75/keymaps/default/keymap.c
Normal file
38
keyboards/mmd/km75/keymaps/default/keymap.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Copyright 2022 Jacky
|
||||
*
|
||||
* 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
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_HOME,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
_______, KC_BRID, KC_BRIU, LGUI(KC_TAB), LGUI(KC_E), KC_MAIL, KC_WHOM, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, RGB_HUD, RGB_MOD, RGB_TOG,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______,
|
||||
_______, _______, _______, _______, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI
|
||||
)
|
||||
};
|
||||
|
25
keyboards/mmd/km75/km75.c
Normal file
25
keyboards/mmd/km75/km75.c
Normal file
@ -0,0 +1,25 @@
|
||||
/* Copyright 2022 Jacky
|
||||
*
|
||||
* 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"
|
||||
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
gpio_set_pin_output(A8);
|
||||
gpio_write_pin_high(A8);
|
||||
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
22
keyboards/mmd/km75/mcuconf.h
Normal file
22
keyboards/mmd/km75/mcuconf.h
Normal file
@ -0,0 +1,22 @@
|
||||
/* Copyright 2022 Jacky
|
||||
*
|
||||
* 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_PWM_USE_TIM3
|
||||
#define STM32_PWM_USE_TIM3 TRUE
|
23
keyboards/mmd/km75/readme.md
Normal file
23
keyboards/mmd/km75/readme.md
Normal file
@ -0,0 +1,23 @@
|
||||
# MMD-KM75
|
||||
|
||||
![](https://raw.githubusercontent.com/JackyJia73/img/main/IMG_20240716_173524.jpg)
|
||||
|
||||
* A customizable soldering 75% keyboard.
|
||||
|
||||
* Keyboard Maintainer: [MMD](https://github.com/Smartmmd)
|
||||
* Hardware Supported: [i-game](http://www.i-game.tech)
|
||||
* Hardware Availability: [i-game](http://www.i-game.tech)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make mmd/km75:default
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make mmd/km75:default:flash
|
||||
|
||||
See the build environment setup and the make instructions for more information. Brand new to QMK? Start with our Complete Newbs Guide.
|
||||
|
||||
## Bootloader ESC the bootloader in 3 ways:
|
||||
* **Bootmagic reset: Hold down Enter in the keyboard then replug
|
||||
* **Physical reset button: Briefly press the button on the back of the PCB
|
||||
* **Keycode in layout: Press the key mapped to QK_BOOT
|
1
keyboards/mmd/km75/rules.mk
Normal file
1
keyboards/mmd/km75/rules.mk
Normal file
@ -0,0 +1 @@
|
||||
MCU_LDSCRIPT = STM32F103xB
|
@ -1,5 +1,6 @@
|
||||
"""This script automates the copying of the default keymap into your own keymap.
|
||||
"""
|
||||
import re
|
||||
import shutil
|
||||
|
||||
from milc import cli
|
||||
@ -13,6 +14,13 @@ from qmk.keyboard import keyboard_completer, keyboard_folder
|
||||
from qmk.userspace import UserspaceDefs
|
||||
|
||||
|
||||
def validate_keymap_name(name):
|
||||
"""Returns True if the given keymap name contains only a-z, 0-9 and underscore characters.
|
||||
"""
|
||||
regex = re.compile(r'^[a-zA-Z0-9][a-zA-Z0-9_]+$')
|
||||
return bool(regex.match(name))
|
||||
|
||||
|
||||
def prompt_keyboard():
|
||||
prompt = """{fg_yellow}Select Keyboard{style_reset_all}
|
||||
If you`re unsure you can view a full list of supported keyboards with {fg_yellow}qmk list-keyboards{style_reset_all}.
|
||||
@ -60,6 +68,10 @@ def new_keymap(cli):
|
||||
cli.log.error(f'Default keymap {{fg_cyan}}{keymap_path_default}{{fg_reset}} does not exist!')
|
||||
return False
|
||||
|
||||
if not validate_keymap_name(user_name):
|
||||
cli.log.error('Keymap names must contain only {fg_cyan}a-z{fg_reset}, {fg_cyan}0-9{fg_reset} and {fg_cyan}_{fg_reset}! Please choose a different name.')
|
||||
return False
|
||||
|
||||
if keymap_path_new.exists():
|
||||
cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.')
|
||||
return False
|
||||
|
@ -29,6 +29,7 @@ def _convert_macros(via_macros):
|
||||
if len(via_macros) == 0:
|
||||
return list()
|
||||
split_regex = re.compile(r'(}\,)|(\,{)')
|
||||
macro_group_regex = re.compile(r'({.+?})')
|
||||
macros = list()
|
||||
for via_macro in via_macros:
|
||||
# Split VIA macro to its elements
|
||||
@ -38,13 +39,28 @@ def _convert_macros(via_macros):
|
||||
macro_data = list()
|
||||
for m in macro:
|
||||
if '{' in m or '}' in m:
|
||||
# Found keycode(s)
|
||||
keycodes = m.split(',')
|
||||
# Remove whitespaces and curly braces from around keycodes
|
||||
keycodes = list(map(lambda s: s.strip(' {}'), keycodes))
|
||||
# Remove the KC prefix
|
||||
keycodes = list(map(lambda s: s.replace('KC_', ''), keycodes))
|
||||
macro_data.append({"action": "tap", "keycodes": keycodes})
|
||||
# Split macro groups
|
||||
macro_groups = macro_group_regex.findall(m)
|
||||
for macro_group in macro_groups:
|
||||
# Remove whitespaces and curly braces from around group
|
||||
macro_group = macro_group.strip(' {}')
|
||||
|
||||
macro_action = 'tap'
|
||||
macro_keycodes = []
|
||||
|
||||
if macro_group[0] == '+':
|
||||
macro_action = 'down'
|
||||
macro_keycodes.append(macro_group[1:])
|
||||
elif macro_group[0] == '-':
|
||||
macro_action = 'up'
|
||||
macro_keycodes.append(macro_group[1:])
|
||||
else:
|
||||
macro_keycodes.extend(macro_group.split(',') if ',' in macro_group else [macro_group])
|
||||
|
||||
# Remove the KC prefixes
|
||||
macro_keycodes = list(map(lambda s: s.replace('KC_', ''), macro_keycodes))
|
||||
|
||||
macro_data.append({"action": macro_action, "keycodes": macro_keycodes})
|
||||
else:
|
||||
# Found text
|
||||
macro_data.append(m)
|
||||
@ -54,13 +70,13 @@ def _convert_macros(via_macros):
|
||||
|
||||
|
||||
def _fix_macro_keys(keymap_data):
|
||||
macro_no = re.compile(r'MACRO0?([0-9]{1,2})')
|
||||
macro_no = re.compile(r'MACRO0?\(([0-9]{1,2})\)')
|
||||
for i in range(0, len(keymap_data)):
|
||||
for j in range(0, len(keymap_data[i])):
|
||||
kc = keymap_data[i][j]
|
||||
m = macro_no.match(kc)
|
||||
if m:
|
||||
keymap_data[i][j] = f'MACRO_{m.group(1)}'
|
||||
keymap_data[i][j] = f'MC_{m.group(1)}'
|
||||
return keymap_data
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user