update skyloong/gk87/bl_pro

This commit is contained in:
NaturalZh 2024-10-28 17:03:47 +08:00
parent 417f8b6e65
commit 79cde131e9
10 changed files with 40 additions and 99 deletions

View File

@ -1,64 +0,0 @@
// Copyright 2023 NaturalZh (@NaturalZh)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
enum layer_names {
_WIN,
_MAC,
_WIN_INDEX,
_MAC_INDEX
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_WIN] = LAYOUT_all(
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_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_INS, KC_HOME, KC_PGUP,
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_DEL, KC_END, KC_PGDN,
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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_WIN_INDEX), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[_MAC] = LAYOUT_all(
_______, KC_F14, KC_F15, C(KC_UP), G(KC_D), G(KC_SPC), LAG(KC_EJCT), KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, 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_INS, KC_HOME, KC_PGUP,
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_DEL, KC_END, KC_PGDN,
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_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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RCMD, MO(_MAC_INDEX), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
),
[_WIN_INDEX] = LAYOUT_all(
_______, KC_F14, KC_F15, G(KC_TAB), KC_WSCH, G(C(KC_S)), KC_SLEP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, BL_TOGG,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_BRTG, BL_BRTG, KC_DEL, KC_INS, KC_HOME, KC_PGUP,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_END, KC_PGDN,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_UP,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, BL_DOWN, KC_RGHT
),
[_MAC_INDEX] = LAYOUT_all(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, BL_TOGG,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_BRTG, BL_BRTG, KC_DEL, KC_INS, KC_HOME, KC_PGUP,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_END, KC_PGDN,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_UP,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, BL_DOWN, KC_RGHT
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_WIN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[_MAC] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
[_WIN_INDEX] = { ENCODER_CCW_CW(BL_DOWN, BL_UP)},
[_MAC_INDEX] = { ENCODER_CCW_CW(BL_DOWN, BL_UP)}
};
#endif
#if defined(DIP_SWITCH_MAP_ENABLE)
const uint16_t PROGMEM dip_switch_map[NUM_DIP_SWITCHES][NUM_DIP_STATES] = {
DIP_SWITCH_OFF_ON(DF(0), DF(1)),
};
#endif

View File

@ -1,3 +0,0 @@
ENCODER_MAP_ENABLE = yes
DIP_SWITCH_MAP_ENABLE = yes
VIA_ENABLE = yes

View File

@ -12,7 +12,7 @@ The following is the QMK Firmware for the Destop 85% keylayout - designed by Do
* Keyboard Maintainer: [NaturalZh](https://github.com/NaturalZh)
* Hardware Supported: DestopPCB for Skyloong keylayout 85%, STM32F103C8T6
* Hardware Availability: http://www.skyloong.com.cn https://skyloong.vip
* Hardware Availability: [Skyloong CN](http://www.skyloong.com.cn) & [Skyloong HK](https://skyloongtech.com)
Make example for this keyboard (after setting up your build environment):

View File

@ -1,2 +1,3 @@
CUSTOM_MATRIX = lite
SRC += matrix.c
SRC += led_hc595.c

View File

@ -1,11 +1,8 @@
// Copyright 2023 NaturalZh (@NaturalZh)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
#include "led_hc595.h"
#define HC595_ST_PIN B5 //74HC595 storage register clock input
#define HC595_SH_PIN B4 //74HC595 shift register clock input
#define HC595_DS B3 // 74HC595 serial data input
#include "led_hc595.c"
uint8_t IND = 0; //buffer of LED Display
int FN_ON = 0;

View File

@ -9,4 +9,6 @@
# define ENCODER_MAP_KEY_DELAY 10
#endif
#define MATRIX_ROWS 6
#define MATRIX_COLS 16
#define MATRIX_ROW_PINS {A0, A1, A2, A3, A4, B0}

View File

@ -34,10 +34,6 @@
"dip_switch":{
"pins":["A15"]
},
"matrix_pins": {
"cols": [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,null],
"rows": ["A0", "A1", "A2", "A3", "A4", "B0"]
},
"backlight": {
"breathing": true,
"breathing_period": 5,

View File

@ -1,6 +1,6 @@
// Copyright 2023 NaturalZh (@NaturalZh)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
#include "led_hc595.h"
#ifndef HC595_ST_PIN
# error hc595: no storage register clock pins defined!
@ -14,25 +14,6 @@
# error hc595: no serial data input pins defined!
#endif
/*
*LED display driver.74HC595 Serial to parallel control LED field on/off.
* data(default):1-on/0-off (left low bit)
* bit0 --- NUM indicator
* bit1 --- CAPS indicator
* bit2 --- SCR indicator
* bit3 --- WinLock indicator
* bit4 --- Skyloong LOGO display
* bit5 --- Win layer indicator
* bit6 --- MAC layer indicator
*/
#define NUM_ON 0b10000000
#define CAPS_ON 0b01000000
#define SCR_ON 0b00100000
#define WINLK_ON 0b00010000
#define SKYLOONG 0b00001000
#define WIN_ON 0b00000010
#define MAC_ON 0b00000100
#define CLOCK_TIME 15
static inline void gpio_set_pin_output_write_low(pin_t pin) {
@ -63,7 +44,8 @@ static inline void clockPulse(uint16_t n) {
gpio_write_pin_low(HC595_ST_PIN);
}
static void s_serial_to_parallel(uint8_t data) { // Serial port to parallel port function
void s_serial_to_parallel(uint8_t data) __attribute__((unused));
void s_serial_to_parallel(uint8_t data) { // Serial port to parallel port function
gpio_set_pin_output_write_low(HC595_DS);
gpio_set_pin_output_write_low(HC595_SH_PIN);
gpio_set_pin_output_write_low(HC595_ST_PIN);

View File

@ -0,0 +1,31 @@
// Copyright 2023 NaturalZh (@NaturalZh)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
//#include "quantum.h"
#include "atomic_util.h"
#include "gpio.h"
#define HC595_ST_PIN B1 //74HC595 storage register clock input
#define HC595_SH_PIN B0 //74HC595 shift register clock input
#define HC595_DS B3 // 74HC595 serial data input
/*
*LED display driver.74HC595 Serial to parallel control LED field on/off.
* data(default):1-on/0-off (left low bit)
* bit0 --- NUM indicator
* bit1 --- CAPS indicator
* bit2 --- SCR indicator
* bit3 --- WinLock indicator
* bit4 --- Skyloong LOGO display
* bit5 --- Win layer indicator
* bit6 --- MAC layer indicator
*/
#define NUM_ON 0b10000000
#define CAPS_ON 0b01000000
#define SCR_ON 0b00100000
#define WINLK_ON 0b00010000
#define SKYLOONG 0b00001000
#define WIN_ON 0b00000010
#define MAC_ON 0b00000100
void s_serial_to_parallel(uint8_t data);

View File

@ -18,7 +18,6 @@ extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
// user-defined overridable functions
__attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter);