update skyloong/gk87/q1

This commit is contained in:
NaturalZh 2024-10-26 17:02:16 +08:00
parent 3824cf08f8
commit 4ab02f101c
5 changed files with 38 additions and 28 deletions

View File

@ -12,7 +12,7 @@ The following is the QMK Firmware for the Destop 87% keylayout - designed by Do
* Keyboard Maintainer: [NaturalZh](https://github.com/NaturalZh)
* Hardware Supported: DestopPCB for Skyloong keylayout 87%, STM32F103C8T6
* Hardware Availability: https://skyloongtech.com
* Hardware Availability: [Skyloong CN](http://www.skyloong.com.cn) & [Skyloong HK](https://skyloongtech.com/product-category/keyboards/qmkvia-keyboard/)
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,7 +1,6 @@
// Copyright 2023 NaturalZh (@NaturalZh)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "gpio.h"
#include "atomic_util.h"
#include "led_hc595.h"
#ifndef HC595_ST_PIN
# error hc595: no storage register clock pins defined!
@ -15,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) {
@ -43,7 +23,7 @@ static inline void gpio_set_pin_output_write_low(pin_t pin) {
}
}
static inline void sgpio_set_pin_output_write_high(pin_t pin) {
static inline void gpio_set_pin_output_write_high(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
gpio_set_pin_output(pin);
gpio_write_pin_high(pin);
@ -64,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

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