Compare commits

...

40 Commits

Author SHA1 Message Date
yunzii keyboard
3dbd5d04a2
Merge 4401f337ce into 9bea332a21 2024-11-20 22:22:14 -08:00
Ryan
9bea332a21
qmk via2json: Improve macro parsing (#24345) 2024-11-21 17:20:05 +11:00
Ryan
8cbcdcac62
qmk new-keymap: validate keymap name (#23420) 2024-11-21 17:18:51 +11:00
yunzii keyboard
4401f337ce
Update keyboards/yunzii/al68/keyboard.json
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:59:56 +08:00
yunzii keyboard
93fb7fac14
Update keyboards/yunzii/al68/keymaps/default/keymap.c
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:59:36 +08:00
yunzii keyboard
8774667f9a
Update keyboards/yunzii/al68/keymaps/default/keymap.c
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:59:29 +08:00
yunzii keyboard
1a7f7dbba2
Update keyboards/yunzii/al68/al68.h
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:59:13 +08:00
yunzii keyboard
b91e51c6b3
Update keyboards/yunzii/al68/halconf.h
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:59:06 +08:00
yunzii keyboard
ec8dfa1618
Update keyboards/yunzii/al68/keyboard.json
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:58:55 +08:00
yunzii keyboard
7d2053fa8d
Update keyboards/yunzii/al68/keymaps/default/keymap.c
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:58:48 +08:00
yunzii keyboard
da5e7b601c
Update keyboards/yunzii/al68/keymaps/default/rules.mk
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:58:39 +08:00
yunzii keyboard
303a4dcaeb
Update keyboards/yunzii/al68/mcuconf.h
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:58:32 +08:00
yunzii keyboard
0259bcfa42
Update keyboards/yunzii/al68/rules.mk
Co-authored-by: Duncan Sutherland <dunk2k_2000@hotmail.com>
2024-11-05 11:57:55 +08:00
JackyJia73
6ccff10f8c format al68.c 2024-09-10 11:31:54 +08:00
JackyJia73
0e7de51ad5 include quantum.h for clear_eyboard() 2024-09-02 11:37:00 +08:00
yunzii keyboard
f6cdeab1af
Update keyboards/yunzii/common/smart_ble.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
2024-09-02 11:20:38 +08:00
JackyJia73
871456fdbe format smart_blae.c 2024-09-02 11:16:25 +08:00
yunzii keyboard
9b3c02bbd9
Update keyboards/yunzii/common/smart_ble.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
2024-09-02 11:10:40 +08:00
yunzii keyboard
b2f7f4062d
Update keyboards/yunzii/common/smart_ble.h
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:23:50 +08:00
yunzii keyboard
260b511f93
Update keyboards/yunzii/common/smart_ble.h
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:23:42 +08:00
yunzii keyboard
593fb8a184
Update keyboards/yunzii/common/smart_ble.c
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:23:34 +08:00
yunzii keyboard
98818a5f0d
Update keyboards/yunzii/al68/readme.md
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:23:23 +08:00
yunzii keyboard
63cdb42860
Update keyboards/yunzii/al68/readme.md
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:23:14 +08:00
yunzii keyboard
c3e287807e
Update keyboards/yunzii/al68/mcuconf.h
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:23:04 +08:00
yunzii keyboard
7cb2e62e36
Update keyboards/yunzii/al68/keyboard.json
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:22:55 +08:00
yunzii keyboard
f028bc5313
Update keyboards/yunzii/al68/al68.c
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:22:45 +08:00
yunzii keyboard
17ba47e3f4
Update keyboards/yunzii/al68/config.h
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:22:37 +08:00
yunzii keyboard
a2ca106e3e
Update keyboards/yunzii/al68/halconf.h
Co-authored-by: Joel Challis <git@zvecr.com>
2024-08-29 09:22:25 +08:00
yunzii keyboard
33249f3095
Update smart_ble.c 2024-08-28 11:38:42 +08:00
yunzii keyboard
a4c7576d01
Update smart_ble.h 2024-08-28 11:37:58 +08:00
yunzii keyboard
83798c0b99
Update al68.c 2024-08-28 11:36:29 +08:00
yunzii keyboard
827d979fc4
Update keyboards/yunzii/al68/al68.h
Co-authored-by: Drashna Jaelre <drashna@live.com>
2024-08-28 11:30:24 +08:00
yunzii keyboard
5c867196a9
Update keyboards/yunzii/al68/al68.c
Co-authored-by: Drashna Jaelre <drashna@live.com>
2024-08-28 11:29:46 +08:00
yunzii keyboard
7b903c7b27
Merge branch 'qmk:master' into master 2024-08-27 10:16:21 +08:00
yunzii keyboard
46e35687c8
Delete keyboards/yunzii/al68/keymaps/via directory 2024-08-27 10:15:14 +08:00
yunzii keyboard
73ba73d114 ENCODER 2024-08-14 12:17:18 +08:00
yunzii keyboard
3b3bfe8045 Merge branch 'master' of https://github.com/yunziikeyboard/qmk_firmware 2024-08-14 12:14:59 +08:00
yunzii keyboard
186878fdce ENCODER MAP LAYER 2024-08-14 12:14:44 +08:00
yunzii keyboard
6c72d1172d ADD LICENSE 2024-08-14 11:27:53 +08:00
JackyJia73
71531d53fb Add al68 keyboard 2024-08-13 18:12:34 +08:00
14 changed files with 501 additions and 9 deletions

View File

@ -0,0 +1,29 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
#include "uart.h"
#include "common/smart_ble.h"
#include "al68.h"
void keyboard_pre_init_kb(void) {
AFIO->MAPR = (AFIO->MAPR & ~AFIO_MAPR_SWJ_CFG_Msk);
AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_DISABLE; // diable JTAG (GD32 different to STM32)
gpio_set_pin_output(A8);
gpio_write_pin_high(A8); // ENABLE USB
uart_init(460800);
wait_ms(400);
}
bool process_record_kb(uint16_t keycode, keyrecord_t* record) {
if (record->event.pressed) {
if ((keycode >= KC_BLE1) && (keycode <= KC_24G)) {
wireless_start(keycode - KC_USB);
return false;
} else if (keycode == KC_USB) {
wireless_stop();
return false;
}
}
return process_record_user(keycode, record);
}

View File

@ -0,0 +1,23 @@
// /* 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/>.
// */
enum custom_keycodes {
KC_USB = QK_KB_0,
KC_BLE1,
KC_BLE2,
KC_BLE3,
KC_24G
};

View File

@ -0,0 +1,10 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define WS2812_PWM_DRIVER PWMD4
#define WS2812_PWM_CHANNEL 3
#define WS2812_PWM_PAL_MODE 2
#define WS2812_DMA_STREAM STM32_DMA1_STREAM7
#define WS2812_DMA_CHANNEL 7

View File

@ -0,0 +1,8 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define HAL_USE_PWM TRUE
#include_next <halconf.h>

View File

@ -0,0 +1,207 @@
{
"manufacturer": "YUNZII Keyboard",
"keyboard_name": "AL68",
"maintainer": "Jeff",
"bootloader": "stm32duino",
"diode_direction": "ROW2COL",
"encoder": {
"rotary": [
{"pin_a": "A7", "pin_b": "A6"}
]
},
"features": {
"bootmagic": true,
"console": true,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true
},
"matrix_pins": {
"cols": ["B0", "B2", "B10", "B11", "B12", "B13", "B14", "B15", "A14", "B3", "A15", "B5", "B6", "B7", "C13"],
"rows": ["A0", "A1", "A2", "A3", "A4"]
},
"processor": "STM32F103",
"rgb_matrix": {
"animations": {
"band_pinwheel_sat": true,
"band_pinwheel_val": true,
"band_sat": true,
"band_spiral_sat": true,
"band_spiral_val": true,
"band_val": true,
"breathing": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"cycle_up_down": true,
"dual_beacon": true,
"gradient_left_right": true,
"gradient_up_down": true,
"hue_breathing": true,
"hue_pendulum": true,
"hue_wave": true,
"rainbow_beacon": true,
"rainbow_moving_chevron": true,
"rainbow_pinwheels": true
},
"driver": "ws2812",
"layout": [
{"matrix": [4, 5], "x": 95, "y": 64, "flags": 4},
{"matrix": [4, 10], "x": 151, "y": 64, "flags": 4},
{"matrix": [4, 11], "x": 170, "y": 64, "flags": 4},
{"matrix": [4, 12], "x": 183, "y": 64, "flags": 4},
{"matrix": [4, 13], "x": 194, "y": 64, "flags": 4},
{"matrix": [4, 14], "x": 224, "y": 64, "flags": 4},
{"matrix": [3, 14], "x": 224, "y": 48, "flags": 4},
{"matrix": [3, 13], "x": 209, "y": 48, "flags": 4},
{"matrix": [3, 12], "x": 188, "y": 48, "flags": 4},
{"matrix": [3, 11], "x": 168, "y": 48, "flags": 4},
{"matrix": [3, 10], "x": 153, "y": 48, "flags": 4},
{"matrix": [3, 9], "x": 138, "y": 48, "flags": 4},
{"matrix": [3, 8], "x": 123, "y": 48, "flags": 4},
{"matrix": [3, 7], "x": 108, "y": 48, "flags": 4},
{"matrix": [3, 6], "x": 93, "y": 48, "flags": 4},
{"matrix": [3, 5], "x": 78, "y": 48, "flags": 4},
{"matrix": [3, 4], "x": 63, "y": 48, "flags": 4},
{"matrix": [3, 3], "x": 48, "y": 48, "flags": 4},
{"matrix": [3, 2], "x": 34, "y": 48, "flags": 4},
{"matrix": [4, 2], "x": 39, "y": 64, "flags": 4},
{"matrix": [4, 1], "x": 20, "y": 64, "flags": 4},
{"matrix": [4, 0], "x": 2, "y": 64, "flags": 4},
{"matrix": [3, 0], "x": 9, "y": 48, "flags": 4},
{"matrix": [2, 0], "x": 6, "y": 32, "flags": 4},
{"matrix": [2, 1], "x": 25, "y": 32, "flags": 4},
{"matrix": [2, 2], "x": 41, "y": 32, "flags": 4},
{"matrix": [2, 3], "x": 56, "y": 32, "flags": 4},
{"matrix": [2, 4], "x": 71, "y": 32, "flags": 4},
{"matrix": [2, 5], "x": 86, "y": 32, "flags": 4},
{"matrix": [2, 6], "x": 101, "y": 32, "flags": 4},
{"matrix": [2, 7], "x": 116, "y": 32, "flags": 4},
{"matrix": [2, 8], "x": 130, "y": 32, "flags": 4},
{"matrix": [2, 9], "x": 145, "y": 32, "flags": 4},
{"matrix": [2, 10], "x": 160, "y": 32, "flags": 4},
{"matrix": [2, 11], "x": 175, "y": 32, "flags": 4},
{"matrix": [2, 13], "x": 200, "y": 32, "flags": 4},
{"matrix": [2, 14], "x": 224, "y": 32, "flags": 4},
{"matrix": [1, 14], "x": 224, "y": 16, "flags": 4},
{"matrix": [1, 13], "x": 205, "y": 16, "flags": 4},
{"matrix": [1, 12], "x": 187, "y": 16, "flags": 4},
{"matrix": [1, 11], "x": 172, "y": 16, "flags": 4},
{"matrix": [1, 10], "x": 157, "y": 16, "flags": 4},
{"matrix": [1, 9], "x": 142, "y": 16, "flags": 4},
{"matrix": [1, 8], "x": 127, "y": 16, "flags": 4},
{"matrix": [1, 7], "x": 112, "y": 16, "flags": 4},
{"matrix": [1, 6], "x": 97, "y": 16, "flags": 4},
{"matrix": [1, 5], "x": 82, "y": 16, "flags": 4},
{"matrix": [1, 4], "x": 67, "y": 16, "flags": 4},
{"matrix": [1, 3], "x": 52, "y": 16, "flags": 4},
{"matrix": [1, 2], "x": 37, "y": 16, "flags": 4},
{"matrix": [1, 1], "x": 22, "y": 16, "flags": 4},
{"matrix": [1, 0], "x": 4, "y": 16, "flags": 4},
{"matrix": [0, 0], "x": 0, "y": 0, "flags": 4},
{"matrix": [0, 1], "x": 15, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 30, "y": 0, "flags": 4},
{"matrix": [0, 3], "x": 45, "y": 0, "flags": 4},
{"matrix": [0, 4], "x": 60, "y": 0, "flags": 4},
{"matrix": [0, 5], "x": 75, "y": 0, "flags": 4},
{"matrix": [0, 6], "x": 90, "y": 0, "flags": 4},
{"matrix": [0, 7], "x": 105, "y": 0, "flags": 4},
{"matrix": [0, 8], "x": 119, "y": 0, "flags": 4},
{"matrix": [0, 9], "x": 134, "y": 0, "flags": 4},
{"matrix": [0, 10], "x": 149, "y": 0, "flags": 4},
{"matrix": [0, 11], "x": 164, "y": 0, "flags": 4},
{"matrix": [0, 12], "x": 179, "y": 0, "flags": 4},
{"matrix": [0, 13], "x": 202, "y": 0, "flags": 4}
]
},
"url": "https://www.yunzii.com",
"usb": {
"device_version": "1.0.2",
"no_startup_check": true,
"pid": "0x304E",
"vid": "0x414A"
},
"ws2812": {
"driver": "pwm",
"pin": "B8"
},
"community_layouts": ["65_ansi_blocker"],
"layouts": {
"LAYOUT_65_ansi_blocker": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0},
{"matrix": [0, 1], "x": 1, "y": 0},
{"matrix": [0, 2], "x": 2, "y": 0},
{"matrix": [0, 3], "x": 3, "y": 0},
{"matrix": [0, 4], "x": 4, "y": 0},
{"matrix": [0, 5], "x": 5, "y": 0},
{"matrix": [0, 6], "x": 6, "y": 0},
{"matrix": [0, 7], "x": 7, "y": 0},
{"matrix": [0, 8], "x": 8, "y": 0},
{"matrix": [0, 9], "x": 9, "y": 0},
{"matrix": [0, 10], "x": 10, "y": 0},
{"matrix": [0, 11], "x": 11, "y": 0},
{"matrix": [0, 12], "x": 12, "y": 0},
{"matrix": [0, 13], "x": 13, "y": 0, "w": 2},
{"matrix": [0, 14], "x": 15, "y": 0, "encoder": 0},
{"matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
{"matrix": [1, 1], "x": 1.5, "y": 1},
{"matrix": [1, 2], "x": 2.5, "y": 1},
{"matrix": [1, 3], "x": 3.5, "y": 1},
{"matrix": [1, 4], "x": 4.5, "y": 1},
{"matrix": [1, 5], "x": 5.5, "y": 1},
{"matrix": [1, 6], "x": 6.5, "y": 1},
{"matrix": [1, 7], "x": 7.5, "y": 1},
{"matrix": [1, 8], "x": 8.5, "y": 1},
{"matrix": [1, 9], "x": 9.5, "y": 1},
{"matrix": [1, 10], "x": 10.5, "y": 1},
{"matrix": [1, 11], "x": 11.5, "y": 1},
{"matrix": [1, 12], "x": 12.5, "y": 1},
{"matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5},
{"matrix": [1, 14], "x": 15, "y": 1},
{"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
{"matrix": [2, 1], "x": 1.75, "y": 2},
{"matrix": [2, 2], "x": 2.75, "y": 2},
{"matrix": [2, 3], "x": 3.75, "y": 2},
{"matrix": [2, 4], "x": 4.75, "y": 2},
{"matrix": [2, 5], "x": 5.75, "y": 2},
{"matrix": [2, 6], "x": 6.75, "y": 2},
{"matrix": [2, 7], "x": 7.75, "y": 2},
{"matrix": [2, 8], "x": 8.75, "y": 2},
{"matrix": [2, 9], "x": 9.75, "y": 2},
{"matrix": [2, 10], "x": 10.75, "y": 2},
{"matrix": [2, 11], "x": 11.75, "y": 2},
{"matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25},
{"matrix": [2, 14], "x": 15, "y": 2},
{"matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
{"matrix": [3, 2], "x": 2.25, "y": 3},
{"matrix": [3, 3], "x": 3.25, "y": 3},
{"matrix": [3, 4], "x": 4.25, "y": 3},
{"matrix": [3, 5], "x": 5.25, "y": 3},
{"matrix": [3, 6], "x": 6.25, "y": 3},
{"matrix": [3, 7], "x": 7.25, "y": 3},
{"matrix": [3, 8], "x": 8.25, "y": 3},
{"matrix": [3, 9], "x": 9.25, "y": 3},
{"matrix": [3, 10], "x": 10.25, "y": 3},
{"matrix": [3, 11], "x": 11.25, "y": 3},
{"matrix": [3, 12], "x": 12.25, "y": 3, "w": 1.75},
{"matrix": [3, 13], "x": 14, "y": 3},
{"matrix": [3, 14], "x": 15, "y": 3},
{"matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
{"matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25},
{"matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25},
{"matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25},
{"matrix": [4, 10], "x": 10, "y": 4, "w": 1.25},
{"matrix": [4, 11], "x": 11.25, "y": 4, "w": 1.25},
{"matrix": [4, 12], "x": 13, "y": 4},
{"matrix": [4, 13], "x": 14, "y": 4},
{"matrix": [4, 14], "x": 15, "y": 4}
]
}
}
}

View File

@ -0,0 +1,41 @@
/* 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
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[1] = { ENCODER_CCW_CW(_______, _______) }
};
#endif
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_65_ansi_blocker(
KC_ESC, 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_MUTE,
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_DELETE,
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_PAGE_UP,
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_PAGE_DOWN,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT
),
[1] = LAYOUT_65_ansi_blocker(
KC_GRV, KC_BRID, KC_BRIU, _______, KC_MYCM, KC_MAIL, KC_WHOM, KC_MPRV, KC_MPLY, KC_MNXT, _______, KC_VOLD, KC_VOLU, _______, _______,
_______, KC_BLE1, KC_BLE2, KC_BLE3, KC_24G, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUI, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______,
_______, _______, _______, _______, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI
)
};

View File

@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes

View File

@ -0,0 +1,11 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include_next <mcuconf.h>
#undef STM32_SERIAL_USE_USART1
#define STM32_SERIAL_USE_USART1 TRUE
#undef STM32_PWM_USE_TIM4
#define STM32_PWM_USE_TIM4 TRUE

View File

@ -0,0 +1,25 @@
# MK AL68
![AL68](https://i.imgur.com/mhiYDh3.png)
A customizable 68keys keyboard.
* Keyboard Maintainer: [Jeff](https://github.com/yunziikeyboard)
* Hardware Supported: [yunzii](https://www.yunzii.com)
* Hardware Availability: [yunzii](https://www.yunzii.com)
Make example for this keyboard (after setting up your build environment):
make yunzii/al68:default
Flashing example for this keyboard:
make yunzii/al68: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

View File

@ -0,0 +1,3 @@
MCU_LDSCRIPT = STM32F103xB
UART_DRIVER_REQUIRED = yes
SRC += ./common/smart_ble.c

View File

@ -0,0 +1,97 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
#include "uart.h"
#include "ch.h"
#include "hal.h"
#include "host.h"
#include "host_driver.h"
#include "report.h"
#include <string.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);
}

View File

@ -0,0 +1,9 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <stdint.h>
void sc_ble_battary(uint8_t batt_level);
void wireless_start(uint32_t mode);
void wireless_stop(void);

View File

@ -1,5 +1,6 @@
"""This script automates the copying of the default keymap into your own keymap. """This script automates the copying of the default keymap into your own keymap.
""" """
import re
import shutil import shutil
from milc import cli from milc import cli
@ -13,6 +14,13 @@ from qmk.keyboard import keyboard_completer, keyboard_folder
from qmk.userspace import UserspaceDefs 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(): def prompt_keyboard():
prompt = """{fg_yellow}Select Keyboard{style_reset_all} 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}. 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!') cli.log.error(f'Default keymap {{fg_cyan}}{keymap_path_default}{{fg_reset}} does not exist!')
return False 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(): if keymap_path_new.exists():
cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.') cli.log.error(f'Keymap {{fg_cyan}}{user_name}{{fg_reset}} already exists! Please choose a different name.')
return False return False

View File

@ -29,6 +29,7 @@ def _convert_macros(via_macros):
if len(via_macros) == 0: if len(via_macros) == 0:
return list() return list()
split_regex = re.compile(r'(}\,)|(\,{)') split_regex = re.compile(r'(}\,)|(\,{)')
macro_group_regex = re.compile(r'({.+?})')
macros = list() macros = list()
for via_macro in via_macros: for via_macro in via_macros:
# Split VIA macro to its elements # Split VIA macro to its elements
@ -38,13 +39,28 @@ def _convert_macros(via_macros):
macro_data = list() macro_data = list()
for m in macro: for m in macro:
if '{' in m or '}' in m: if '{' in m or '}' in m:
# Found keycode(s) # Split macro groups
keycodes = m.split(',') macro_groups = macro_group_regex.findall(m)
# Remove whitespaces and curly braces from around keycodes for macro_group in macro_groups:
keycodes = list(map(lambda s: s.strip(' {}'), keycodes)) # Remove whitespaces and curly braces from around group
# Remove the KC prefix macro_group = macro_group.strip(' {}')
keycodes = list(map(lambda s: s.replace('KC_', ''), keycodes))
macro_data.append({"action": "tap", "keycodes": keycodes}) 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: else:
# Found text # Found text
macro_data.append(m) macro_data.append(m)
@ -54,13 +70,13 @@ def _convert_macros(via_macros):
def _fix_macro_keys(keymap_data): 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 i in range(0, len(keymap_data)):
for j in range(0, len(keymap_data[i])): for j in range(0, len(keymap_data[i])):
kc = keymap_data[i][j] kc = keymap_data[i][j]
m = macro_no.match(kc) m = macro_no.match(kc)
if m: if m:
keymap_data[i][j] = f'MACRO_{m.group(1)}' keymap_data[i][j] = f'MC_{m.group(1)}'
return keymap_data return keymap_data