mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-25 01:47:10 +06:00
Update V5
This commit is contained in:
parent
d6ffbc9363
commit
6ff514defb
|
@ -8,6 +8,20 @@
|
|||
"pid": "0x0350",
|
||||
"device_version": "1.0.2"
|
||||
},
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"dip_switch": true,
|
||||
"encoder": false,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
"rgb_matrix": true
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "CKLED2001"
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["A10", "A9", "A8", "B1", "B0", "A7", "A6", "A5", "A4", "A3", null, null, null, null, null, null, null, null],
|
||||
"rows": ["B5", "B4", "B3", "A15", "A14", "A13"]
|
||||
|
|
|
@ -30,7 +30,7 @@ enum layers{
|
|||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[MAC_BASE] = LAYOUT_ansi_100(
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, RGB_MOD,
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, RGB_MOD,
|
||||
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_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
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_P4, KC_P5, KC_P6,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
VPATH += keyboards/keychron/common
|
||||
SRC += keychron_common.c keychron_ft_common.c
|
||||
|
|
|
@ -30,7 +30,7 @@ enum layers{
|
|||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[MAC_BASE] = LAYOUT_ansi_100(
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, RGB_MOD,
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, RGB_MOD,
|
||||
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_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
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_P4, KC_P5, KC_P6,
|
||||
|
|
|
@ -1,18 +1,4 @@
|
|||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Enable USB N-key Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
DIP_SWITCH_ENABLE = yes
|
||||
RGB_MATRIX_ENABLE = yes
|
||||
RGB_MATRIX_DRIVER = CKLED2001
|
||||
EEPROM_DRIVER = wear_leveling
|
||||
WEAR_LEVELING_DRIVER = embedded_flash
|
||||
|
||||
|
@ -22,4 +8,5 @@ OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
|
|||
# custom matrix setup
|
||||
CUSTOM_MATRIX = lite
|
||||
|
||||
VPATH += keyboards/keychron/common
|
||||
SRC += matrix.c
|
||||
|
|
|
@ -167,42 +167,3 @@ led_config_t g_led_config = {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS)
|
||||
|
||||
void encoder0_pad_cb(void *param) {
|
||||
(void)param;
|
||||
|
||||
encoder_inerrupt_read(0);
|
||||
}
|
||||
|
||||
void encoder1_pad_cb(void *param) {
|
||||
(void)param;
|
||||
|
||||
encoder_inerrupt_read(1);
|
||||
}
|
||||
|
||||
void encoder_interrupt_init(void) {
|
||||
pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A;
|
||||
pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B;
|
||||
for (uint8_t i = 0; i < NUM_ENCODERS; i++) {
|
||||
palEnableLineEvent(encoders_pad_a[i], PAL_EVENT_MODE_BOTH_EDGES);
|
||||
palEnableLineEvent(encoders_pad_b[i], PAL_EVENT_MODE_BOTH_EDGES);
|
||||
}
|
||||
if (NUM_ENCODERS > 0) {
|
||||
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
|
||||
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
|
||||
}
|
||||
if (NUM_ENCODERS > 1) {
|
||||
palSetLineCallback(encoders_pad_a[1], encoder1_pad_cb, NULL);
|
||||
palSetLineCallback(encoders_pad_b[1], encoder1_pad_cb, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
encoder_interrupt_init();
|
||||
// allow user keymaps to do custom post_init
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -8,6 +8,20 @@
|
|||
"pid": "0x0351",
|
||||
"device_version": "1.0.1"
|
||||
},
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"dip_switch": true,
|
||||
"encoder": true,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
"rgb_matrix": true
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "CKLED2001"
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["A10", "A9", "A8", "B1", "B0", "A7", "A6", "A5", "A4", "A3", null, null, null, null, null, null, null, null],
|
||||
"rows": ["B5", "B4", "B3", "A15", "A14", "A13"]
|
||||
|
|
|
@ -30,7 +30,7 @@ enum layers{
|
|||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[MAC_BASE] = LAYOUT_ansi_98(
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_MUTE,
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_MUTE,
|
||||
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_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
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_P4, KC_P5, KC_P6,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
VIA_ENABLE = yes
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
||||
VPATH += keyboards/keychron/common
|
||||
SRC += keychron_common.c keychron_ft_common.c
|
||||
|
|
|
@ -30,7 +30,7 @@ enum layers{
|
|||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[MAC_BASE] = LAYOUT_ansi_98(
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_MUTE,
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_MUTE,
|
||||
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_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
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_P4, KC_P5, KC_P6,
|
||||
|
|
|
@ -1,19 +1,4 @@
|
|||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Enable USB N-key Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
ENCODER_ENABLE = yes # Enable Encoder
|
||||
DIP_SWITCH_ENABLE = yes
|
||||
RGB_MATRIX_ENABLE = yes
|
||||
RGB_MATRIX_DRIVER = CKLED2001
|
||||
EEPROM_DRIVER = wear_leveling
|
||||
WEAR_LEVELING_DRIVER = embedded_flash
|
||||
|
||||
|
@ -23,4 +8,5 @@ OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
|
|||
# custom matrix setup
|
||||
CUSTOM_MATRIX = lite
|
||||
|
||||
VPATH += keyboards/keychron/common
|
||||
SRC += matrix.c
|
||||
|
|
|
@ -104,3 +104,10 @@
|
|||
/* Factory test keys */
|
||||
#define FN_KEY1 MO(1)
|
||||
#define FN_KEY2 MO(3)
|
||||
|
||||
#define HC595_DS C15
|
||||
#define HC595_SHCP A1
|
||||
#define HC595_STCP A0
|
||||
|
||||
#define SHIFT_COL_START 10
|
||||
#define SHIFT_COL_END MATRIX_COLS
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#pragma once
|
||||
|
||||
#define HAL_USE_I2C TRUE
|
||||
#define PAL_USE_CALLBACKS TRUE
|
||||
#ifdef ENCODER_ENABLE
|
||||
# define PAL_USE_CALLBACKS TRUE
|
||||
#endif
|
||||
|
||||
#include_next <halconf.h>
|
||||
|
|
|
@ -8,6 +8,20 @@
|
|||
"pid": "0x0352",
|
||||
"device_version": "1.0.1"
|
||||
},
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"dip_switch": true,
|
||||
"encoder": false,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
"rgb_matrix": true
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "CKLED2001"
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["A10", "A9", "A8", "B1", "B0", "A7", "A6", "A5", "A4", "A3", null, null, null, null, null, null, null, null],
|
||||
"rows": ["B5", "B4", "B3", "A15", "A14", "A13"]
|
||||
|
|
|
@ -30,7 +30,7 @@ enum layers{
|
|||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[MAC_BASE] = LAYOUT_iso_101(
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, RGB_MOD,
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, RGB_MOD,
|
||||
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_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
VPATH += keyboards/keychron/common
|
||||
SRC += keychron_common.c keychron_ft_common.c
|
||||
|
|
|
@ -30,7 +30,7 @@ enum layers{
|
|||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[MAC_BASE] = LAYOUT_iso_101(
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, RGB_MOD,
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, RGB_MOD,
|
||||
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_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
|
|
|
@ -1,18 +1,4 @@
|
|||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Enable USB N-key Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
DIP_SWITCH_ENABLE = yes
|
||||
RGB_MATRIX_ENABLE = yes
|
||||
RGB_MATRIX_DRIVER = CKLED2001
|
||||
EEPROM_DRIVER = wear_leveling
|
||||
WEAR_LEVELING_DRIVER = embedded_flash
|
||||
|
||||
|
@ -22,4 +8,5 @@ OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
|
|||
# custom matrix setup
|
||||
CUSTOM_MATRIX = lite
|
||||
|
||||
VPATH += keyboards/keychron/common
|
||||
SRC += matrix.c
|
||||
|
|
|
@ -8,6 +8,20 @@
|
|||
"pid": "0x0353",
|
||||
"device_version": "1.0.1"
|
||||
},
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"dip_switch": true,
|
||||
"encoder": true,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
"rgb_matrix": true
|
||||
},
|
||||
"rgb_matrix": {
|
||||
"driver": "CKLED2001"
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["A10", "A9", "A8", "B1", "B0", "A7", "A6", "A5", "A4", "A3", null, null, null, null, null, null, null, null],
|
||||
"rows": ["B5", "B4", "B3", "A15", "A14", "A13"]
|
||||
|
|
|
@ -166,42 +166,3 @@ led_config_t g_led_config = {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(ENCODER_ENABLE) && defined(PAL_USE_CALLBACKS)
|
||||
|
||||
void encoder0_pad_cb(void *param) {
|
||||
(void)param;
|
||||
|
||||
encoder_inerrupt_read(0);
|
||||
}
|
||||
|
||||
void encoder1_pad_cb(void *param) {
|
||||
(void)param;
|
||||
|
||||
encoder_inerrupt_read(1);
|
||||
}
|
||||
|
||||
void encoder_interrupt_init(void) {
|
||||
pin_t encoders_pad_a[NUM_ENCODERS] = ENCODERS_PAD_A;
|
||||
pin_t encoders_pad_b[NUM_ENCODERS] = ENCODERS_PAD_B;
|
||||
for (uint8_t i = 0; i < NUM_ENCODERS; i++) {
|
||||
palEnableLineEvent(encoders_pad_a[i], PAL_EVENT_MODE_BOTH_EDGES);
|
||||
palEnableLineEvent(encoders_pad_b[i], PAL_EVENT_MODE_BOTH_EDGES);
|
||||
}
|
||||
if (NUM_ENCODERS > 0) {
|
||||
palSetLineCallback(encoders_pad_a[0], encoder0_pad_cb, NULL);
|
||||
palSetLineCallback(encoders_pad_b[0], encoder0_pad_cb, NULL);
|
||||
}
|
||||
if (NUM_ENCODERS > 1) {
|
||||
palSetLineCallback(encoders_pad_a[1], encoder1_pad_cb, NULL);
|
||||
palSetLineCallback(encoders_pad_b[1], encoder1_pad_cb, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void keyboard_post_init_kb(void) {
|
||||
encoder_interrupt_init();
|
||||
// allow user keymaps to do custom post_init
|
||||
keyboard_post_init_user();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -30,7 +30,7 @@ enum layers{
|
|||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[MAC_BASE] = LAYOUT_iso_99(
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_MUTE,
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_MUTE,
|
||||
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_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
VIA_ENABLE = yes
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
||||
VPATH += keyboards/keychron/common
|
||||
SRC += keychron_common.c keychron_ft_common.c
|
||||
|
|
|
@ -30,7 +30,7 @@ enum layers{
|
|||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[MAC_BASE] = LAYOUT_iso_99(
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_MUTE,
|
||||
KC_ESC, KC_BRID, KC_BRIU, KC_MCTL, KC_LPAD, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL, KC_HOME, KC_END, KC_MUTE,
|
||||
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_NUM, KC_PSLS, KC_PAST, KC_PMNS,
|
||||
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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6,
|
||||
|
|
|
@ -1,19 +1,4 @@
|
|||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Enable USB N-key Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
ENCODER_ENABLE = yes # Enable Encoder
|
||||
DIP_SWITCH_ENABLE = yes
|
||||
RGB_MATRIX_ENABLE = yes
|
||||
RGB_MATRIX_DRIVER = CKLED2001
|
||||
EEPROM_DRIVER = wear_leveling
|
||||
WEAR_LEVELING_DRIVER = embedded_flash
|
||||
|
||||
|
@ -23,4 +8,5 @@ OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
|
|||
# custom matrix setup
|
||||
CUSTOM_MATRIX = lite
|
||||
|
||||
VPATH += keyboards/keychron/common
|
||||
SRC += matrix.c
|
||||
|
|
|
@ -1,209 +0,0 @@
|
|||
/* 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"
|
||||
|
||||
#define HC595_DS C15
|
||||
#define HC595_SHCP A1
|
||||
#define HC595_STCP A0
|
||||
|
||||
static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
|
||||
#define ROWS_PER_HAND (MATRIX_ROWS)
|
||||
|
||||
static inline void setPinOutput_writeLow(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinOutput(pin);
|
||||
writePinLow(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void setPinOutput_writeHigh(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinOutput(pin);
|
||||
writePinHigh(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void setPinInputHigh_atomic(pin_t pin) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
setPinInputHigh(pin);
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint8_t readMatrixPin(pin_t pin) {
|
||||
if (pin != NO_PIN) {
|
||||
return readPin(pin);
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void HC595_delay(uint16_t n) {
|
||||
while (n-- > 0) {
|
||||
asm volatile("nop" ::: "memory");
|
||||
};
|
||||
}
|
||||
|
||||
static void HC595_output(uint8_t data) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
if (data & 0x1) {
|
||||
writePinHigh(HC595_DS);
|
||||
} else {
|
||||
writePinLow(HC595_DS);
|
||||
}
|
||||
data = data >> 1;
|
||||
writePinHigh(HC595_SHCP);
|
||||
HC595_delay(3);
|
||||
writePinLow(HC595_SHCP);
|
||||
}
|
||||
writePinHigh(HC595_STCP);
|
||||
HC595_delay(3);
|
||||
writePinLow(HC595_STCP);
|
||||
}
|
||||
}
|
||||
|
||||
static void HC595_output_bit(uint8_t data) {
|
||||
ATOMIC_BLOCK_FORCEON {
|
||||
if (data & 0x1) {
|
||||
writePinHigh(HC595_DS);
|
||||
} else {
|
||||
writePinLow(HC595_DS);
|
||||
}
|
||||
writePinHigh(HC595_SHCP);
|
||||
HC595_delay(3);
|
||||
writePinLow(HC595_SHCP);
|
||||
writePinHigh(HC595_STCP);
|
||||
HC595_delay(3);
|
||||
writePinLow(HC595_STCP);
|
||||
}
|
||||
}
|
||||
|
||||
static bool select_col(uint8_t col) {
|
||||
pin_t pin = col_pins[col];
|
||||
|
||||
if (pin != NO_PIN) {
|
||||
setPinOutput_writeLow(pin);
|
||||
return true;
|
||||
} else {
|
||||
if (col == 11) {
|
||||
HC595_output_bit(0x00);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void unselect_col(uint8_t col) {
|
||||
pin_t pin = col_pins[col];
|
||||
|
||||
if (pin != NO_PIN) {
|
||||
#ifdef MATRIX_UNSELECT_DRIVE_HIGH
|
||||
setPinOutput_writeHigh(pin);
|
||||
#else
|
||||
setPinInputHigh_atomic(pin);
|
||||
#endif
|
||||
} else {
|
||||
HC595_output_bit(0x01);
|
||||
}
|
||||
}
|
||||
|
||||
static void unselect_cols(void) {
|
||||
// unselect column pins
|
||||
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
pin_t pin = col_pins[x];
|
||||
|
||||
if (pin != NO_PIN) {
|
||||
#ifdef MATRIX_UNSELECT_DRIVE_HIGH
|
||||
setPinOutput_writeHigh(pin);
|
||||
#else
|
||||
setPinInputHigh_atomic(pin);
|
||||
#endif
|
||||
}
|
||||
if (x == 11)
|
||||
// unselect Shift Register
|
||||
HC595_output(0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
static void matrix_init_pins(void) {
|
||||
setPinOutput(HC595_DS);
|
||||
setPinOutput(HC595_SHCP);
|
||||
setPinOutput(HC595_STCP);
|
||||
#ifdef MATRIX_UNSELECT_DRIVE_HIGH
|
||||
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
if (col_pins[x] != NO_PIN) {
|
||||
setPinOutput(col_pins[x]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
unselect_cols();
|
||||
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||
if (row_pins[x] != NO_PIN) {
|
||||
setPinInputHigh_atomic(row_pins[x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter) {
|
||||
bool key_pressed = false;
|
||||
|
||||
// Select col
|
||||
if (!select_col(current_col)) { // select col
|
||||
return; // skip NO_PIN col
|
||||
}
|
||||
|
||||
matrix_output_select_delay();
|
||||
|
||||
// For each row...
|
||||
for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) {
|
||||
// Check row pin state
|
||||
if (readMatrixPin(row_pins[row_index]) == 0) {
|
||||
// Pin LO, set col bit
|
||||
current_matrix[row_index] |= row_shifter;
|
||||
key_pressed = true;
|
||||
} else {
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~row_shifter;
|
||||
}
|
||||
}
|
||||
|
||||
// Unselect col
|
||||
unselect_col(current_col);
|
||||
matrix_output_unselect_delay(current_col, key_pressed); // wait for all Row signals to go HIGH
|
||||
}
|
||||
|
||||
void matrix_init_custom(void) {
|
||||
// initialize key pins
|
||||
matrix_init_pins();
|
||||
}
|
||||
|
||||
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
|
||||
matrix_row_t curr_matrix[MATRIX_ROWS] = {0};
|
||||
|
||||
// Set col, read rows
|
||||
matrix_row_t row_shifter = MATRIX_ROW_SHIFTER;
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++, row_shifter <<= 1) {
|
||||
matrix_read_rows_on_col(curr_matrix, current_col, row_shifter);
|
||||
}
|
||||
|
||||
bool changed = memcmp(current_matrix, curr_matrix, sizeof(curr_matrix)) != 0;
|
||||
if (changed) memcpy(current_matrix, curr_matrix, sizeof(curr_matrix));
|
||||
|
||||
return changed;
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
# Keychron V5
|
||||
|
||||
[Keychron V5](https://i.imgur.com/5aT9lhP.jpg[/img])
|
||||
[Keychron V5](https://i.imgur.com/5aT9lhP.jpg)
|
||||
|
||||
A customizable 96% keyboard.
|
||||
|
||||
|
|
|
@ -36,7 +36,3 @@ bool dip_switch_update_kb(uint8_t index, bool active) {
|
|||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void restart_usb_driver(USBDriver *usbp) {
|
||||
(void)usbp;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user