mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-22 00:16:41 +06:00
Migrate led_update_kb
implementations to DD (#23981)
This commit is contained in:
parent
cb39df273d
commit
17498fa48a
|
@ -22,6 +22,11 @@
|
|||
"resync": true
|
||||
}
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "B7",
|
||||
"scroll_lock": "A5",
|
||||
"on_state": 0
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["B5", "A3", "A9", "A8", "B15", "B14", "B13", "B12", "B11", "B10", "B2", "B1", "B0", "A7", "A6"],
|
||||
"rows": ["A1", "A2", "B3", "A15", "A10"]
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
/* Copyright 2020 ai03
|
||||
*
|
||||
* 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 matrix_init_kb(void) {
|
||||
// Initialize indicator LEDs to output
|
||||
|
||||
gpio_set_pin_output(B7); // Caps
|
||||
gpio_set_pin_output(A5); // Slck
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
|
||||
bool res = led_update_user(led_state);
|
||||
|
||||
if(res) {
|
||||
gpio_write_pin(B7, !led_state.caps_lock);
|
||||
gpio_write_pin(A5, !led_state.scroll_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
Copyright 2019 Basic I/O Instruments(Scott Wei) <scot.wei@gmail.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"
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
gpio_set_pin_output(F0);
|
||||
gpio_write_pin_high(F0);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (led_update_user(led_state)) {
|
||||
gpio_write_pin(F0, !led_state.caps_lock);
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -35,6 +35,10 @@
|
|||
"pin": "B7",
|
||||
"levels": 12
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "F0",
|
||||
"on_state": 0
|
||||
},
|
||||
"rgblight": {
|
||||
"saturation_steps": 8,
|
||||
"brightness_steps": 8,
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
"pin": "B6",
|
||||
"levels": 12
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "F0",
|
||||
"on_state": 0
|
||||
},
|
||||
"rgblight": {
|
||||
"saturation_steps": 8,
|
||||
"brightness_steps": 8,
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
Copyright 2019 Basic I/O Instruments(Scott Wei) <scot.wei@gmail.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"
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
gpio_set_pin_output(F0);
|
||||
gpio_write_pin_high(F0);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (led_update_user(led_state)) {
|
||||
gpio_write_pin(F0, !led_state.caps_lock);
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -35,6 +35,10 @@
|
|||
"pin": "B6",
|
||||
"levels": 12
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "F0",
|
||||
"on_state": 0
|
||||
},
|
||||
"rgblight": {
|
||||
"saturation_steps": 8,
|
||||
"brightness_steps": 8,
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
Copyright 2019 Basic I/O Instruments(Scott Wei) <scot.wei@gmail.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"
|
||||
void keyboard_pre_init_kb(void) {
|
||||
gpio_set_pin_output(F0);
|
||||
gpio_write_pin_high(F0);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (led_update_user(led_state)) {
|
||||
gpio_write_pin(F0, !led_state.caps_lock);
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -18,9 +18,6 @@
|
|||
void matrix_init_kb(void) {
|
||||
// Set our LED pins as output
|
||||
gpio_set_pin_output(D6);
|
||||
gpio_set_pin_output(B4);
|
||||
gpio_set_pin_output(B5);
|
||||
gpio_set_pin_output(B6);
|
||||
|
||||
// Set our Tilt Sensor pins as input
|
||||
gpio_set_pin_input_high(SHAKE_PIN_A);
|
||||
|
@ -133,17 +130,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
|||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
gpio_write_pin(B4, !led_state.num_lock);
|
||||
gpio_write_pin(B5, !led_state.caps_lock);
|
||||
gpio_write_pin(B6, !led_state.scroll_lock);
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
__attribute__((weak)) bool encoder_update_keymap(uint8_t index, bool clockwise) { return true; }
|
||||
__attribute__((weak)) bool encoder_update_user(uint8_t index, bool clockwise) { return encoder_update_keymap(index, clockwise); }
|
||||
|
||||
|
|
|
@ -32,6 +32,12 @@
|
|||
{"pin_a": "A1", "pin_b": "A0"}
|
||||
]
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "B5",
|
||||
"num_lock": "B4",
|
||||
"scroll_lock": "B6",
|
||||
"on_state": 0
|
||||
},
|
||||
"layout_aliases": {
|
||||
"LAYOUT": "LAYOUT_all"
|
||||
},
|
||||
|
|
|
@ -16,6 +16,12 @@
|
|||
"bootmagic": {
|
||||
"matrix": [4, 10]
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "B0",
|
||||
"num_lock": "B4",
|
||||
"scroll_lock": "D7",
|
||||
"on_state": 0
|
||||
},
|
||||
"rgblight": {
|
||||
"led_count": 18,
|
||||
"animations": {
|
||||
|
|
|
@ -53,20 +53,7 @@ __attribute__ ((weak))
|
|||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
void indicator_init_ports(void) {
|
||||
|
||||
// Num LED
|
||||
gpio_set_pin_output(B4);
|
||||
|
||||
// Caps Lock
|
||||
gpio_set_pin_output(B0);
|
||||
|
||||
// Scroll Lock
|
||||
gpio_set_pin_output(D7);
|
||||
}
|
||||
|
||||
void matrix_init(void) {
|
||||
indicator_init_ports();
|
||||
unselect_cols();
|
||||
init_rows();
|
||||
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
/* Copyright 2019 MechMerlin <mechmerlin@gmail.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"
|
||||
#include "indicator_leds.h"
|
||||
|
||||
// Alphas PB1
|
||||
// Navigation Cluster: PB2
|
||||
// Number Row, Mods: PB3
|
||||
// Function Row: PE6
|
||||
|
||||
// Other than using RGB or LED matrix, QMK cannot turn on specific zones
|
||||
// of backlight LEDs. Unfortunately, Duck PCBs do not follow this design
|
||||
// and instead use multiple pins connected to each of these zones. QMK is
|
||||
// only able to control them ALL with the current default mechanisms.
|
||||
|
||||
// Locking indicator LEDs
|
||||
// The Duck Orion V3 has 3 locking indicator LEDs and are located to the right
|
||||
// of the Escape key.
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if(led_update_user(led_state)) {
|
||||
gpio_write_pin(B0, !led_state.caps_lock);
|
||||
gpio_write_pin(B4, !led_state.num_lock);
|
||||
gpio_write_pin(D7, !led_state.scroll_lock);
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -34,6 +34,9 @@
|
|||
{"pin_a": "D5", "pin_b": "F1"}
|
||||
]
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "F0"
|
||||
},
|
||||
"rgblight": {
|
||||
"saturation_steps": 8,
|
||||
"brightness_steps": 8,
|
||||
|
|
|
@ -52,16 +52,3 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
gpio_set_pin_output(F0);
|
||||
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (led_update_user(led_state)) {
|
||||
gpio_write_pin(F0, led_state.caps_lock);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
"rows": ["F4", "F1", "F0", "C7", "B6"]
|
||||
},
|
||||
"diode_direction": "COL2ROW",
|
||||
"indicators": {
|
||||
"caps_lock": "B0"
|
||||
},
|
||||
"split": {
|
||||
"enabled": true,
|
||||
"soft_serial_pin": "D0",
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
/* Copyright 2020 jtallbean
|
||||
*
|
||||
* 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"
|
||||
|
||||
// Optional override functions below.
|
||||
// You can leave any or all of these undefined.
|
||||
// These are only required if you want to perform custom actions.
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
// Set our LED pins as output
|
||||
gpio_set_pin_output(B0);
|
||||
gpio_write_pin_low(B0);
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
// gpio_write_pin sets the pin high for 1 and low for 0.
|
||||
gpio_write_pin(B0, led_state.caps_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -8,6 +8,10 @@
|
|||
"pid": "0x6579",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "B0",
|
||||
"num_lock": "B1"
|
||||
},
|
||||
"rgblight": {
|
||||
"led_count": 10,
|
||||
"animations": {
|
||||
|
|
|
@ -16,32 +16,17 @@
|
|||
#include "quantum.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// set CapsLock LED to output and low
|
||||
gpio_set_pin_output(B0);
|
||||
gpio_write_pin_low(B0);
|
||||
// set NumLock LED to output and low
|
||||
gpio_set_pin_output(B1);
|
||||
gpio_write_pin_low(B1);
|
||||
// set ScrollLock LED to output and low
|
||||
gpio_set_pin_output(B2);
|
||||
gpio_write_pin_low(B2);
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
gpio_write_pin(B1, led_state.num_lock);
|
||||
gpio_write_pin(B0, led_state.caps_lock);
|
||||
//gpio_write_pin(B2, led_state.scroll_lock);
|
||||
}
|
||||
return res;
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
//function for layer indicator LED
|
||||
layer_state_t layer_state_set_kb(layer_state_t state)
|
||||
{
|
||||
if (get_highest_layer(state) == 1) {
|
||||
gpio_write_pin_high(B2);
|
||||
gpio_write_pin_high(B2);
|
||||
} else {
|
||||
gpio_write_pin_low(B2);
|
||||
}
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/* Copyright 2019 ashpil
|
||||
*
|
||||
* 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) {
|
||||
/* Setting status LEDs pins to output and +5V (off) */
|
||||
gpio_set_pin_output(D5);
|
||||
gpio_set_pin_output(D6);
|
||||
gpio_set_pin_output(D7);
|
||||
gpio_write_pin_high(D5);
|
||||
gpio_write_pin_high(D6);
|
||||
gpio_write_pin_high(D7);
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if(led_update_user(led_state)) {
|
||||
gpio_write_pin(D5, !led_state.num_lock);
|
||||
gpio_write_pin(D6, !led_state.caps_lock);
|
||||
gpio_write_pin(D7, !led_state.scroll_lock);
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -16,6 +16,12 @@
|
|||
"mousekey": false,
|
||||
"nkro": false
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "D6",
|
||||
"num_lock": "D5",
|
||||
"scroll_lock": "D7",
|
||||
"on_state": 0
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["E6", "E7", "F0", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "A0", "A1", "A2", "A3", "A4", "A5"],
|
||||
"rows": ["C7", "C6", "C5", "C4", "C3", "C2", "C1", "C0"]
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
"pid": "0x0000",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "B6",
|
||||
"num_lock": "B4",
|
||||
"scroll_lock": "B5",
|
||||
"on_state": 0
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["C7", "C6", "C5", "C4", "C3", "C2", "C1", "C0", "E1", "E0", "D7", "D6", "D5", "D4", "D3", "D2"],
|
||||
"rows": ["F7", "F6", "F5", "F4", "F3", "F2", "F1", "F0"]
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
/* Copyright 2019 iw0rm3r
|
||||
*
|
||||
* 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 led_init_ports(void) {
|
||||
/* Setting status LEDs pins to output and +5V (off) */
|
||||
gpio_set_pin_output(B4);
|
||||
gpio_set_pin_output(B5);
|
||||
gpio_set_pin_output(B6);
|
||||
gpio_write_pin_high(B4);
|
||||
gpio_write_pin_high(B5);
|
||||
gpio_write_pin_high(B6);
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
gpio_write_pin(B4, !led_state.num_lock);
|
||||
gpio_write_pin(B6, !led_state.caps_lock);
|
||||
gpio_write_pin(B5, !led_state.scroll_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -16,6 +16,12 @@
|
|||
"mousekey": true,
|
||||
"nkro": false
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "A1",
|
||||
"num_lock": "A2",
|
||||
"scroll_lock": "A0",
|
||||
"on_state": 0
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["A9", "A8", "B15", "B14", "B13", "B12", "B11", "B10", "B2", "B1", "B0", "A7", "A6", "A5", "A4", "A3"],
|
||||
"rows": ["B8", "B7", "B6", "B5", "B4", "B3", "A15", "A14"]
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
/* Copyright 2020 Nidzo Tomic <tomicn8@hotmail.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"
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
// Set our LED pins as output
|
||||
gpio_set_pin_output(A2);
|
||||
gpio_set_pin_output(A1);
|
||||
gpio_set_pin_output(A0);
|
||||
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
gpio_write_pin(A2, !led_state.num_lock);
|
||||
gpio_write_pin(A1, !led_state.caps_lock);
|
||||
gpio_write_pin(A0, !led_state.scroll_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
/* Copyright 2021 Joah Nelson (Jels)
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
// not much here ... just indicator LEDs
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
// LED indicator pins
|
||||
#define CAPS_LED D5
|
||||
#define SCROLL_LED D4
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
gpio_set_pin_output(CAPS_LED);
|
||||
gpio_set_pin_output(SCROLL_LED);
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if (res) {
|
||||
gpio_write_pin(CAPS_LED, led_state.caps_lock);
|
||||
gpio_write_pin(SCROLL_LED, led_state.scroll_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -23,6 +23,10 @@
|
|||
"resync": true
|
||||
}
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "D5",
|
||||
"scroll_lock": "D4"
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["C7", "C6", "F7", "F6", "F5", "F4", "B1", "D2", "D3"],
|
||||
"rows": ["B3", "B2", "D1", "D0", "E6", "B0", "F0", "F1", "B5", "B4", "D7", "D6"]
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
"backlight": {
|
||||
"pin": "B7"
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "E6",
|
||||
"on_state": 0
|
||||
},
|
||||
"processor": "atmega32u4",
|
||||
"bootloader": "atmel-dfu",
|
||||
"layouts": {
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/* Copyright 2020 dztech
|
||||
*
|
||||
* 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 matrix_init_kb(void) {
|
||||
gpio_set_pin_output(E6);
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
gpio_write_pin(E6, !led_state.caps_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -31,6 +31,10 @@
|
|||
"backlight": {
|
||||
"pin": "B5"
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "D4",
|
||||
"on_state": 0
|
||||
},
|
||||
"processor": "atmega32u4",
|
||||
"bootloader": "atmel-dfu",
|
||||
"debounce": 3,
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
/* Copyright 2020 dztech kbdfans
|
||||
*
|
||||
* 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 matrix_init_kb(void) {
|
||||
gpio_set_pin_output(D4);
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
gpio_write_pin(D4, !led_state.caps_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
/* Copyright 2021 Samuel Lu
|
||||
*
|
||||
* 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 matrix_init_kb(void) {
|
||||
|
||||
gpio_set_pin_output(LED_CAPS_LOCK_PIN);
|
||||
gpio_set_pin_output(LED_SCROLL_LOCK_PIN);
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
|
||||
bool res = led_update_user(led_state);
|
||||
|
||||
if(res) {
|
||||
gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
|
||||
gpio_write_pin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -17,26 +17,11 @@
|
|||
#include "quantum.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// Initialize indicator LEDs to output
|
||||
|
||||
gpio_set_pin_output(LED_CAPS_LOCK_PIN); // Caps
|
||||
gpio_set_pin_output(LED_SCROLL_LOCK_PIN); // Scroll lock
|
||||
gpio_set_pin_output(INDICATOR_PIN_0); // Layer indicator on F13
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
|
||||
bool res = led_update_user(led_state);
|
||||
|
||||
if(res) {
|
||||
gpio_write_pin(LED_CAPS_LOCK_PIN, led_state.caps_lock);
|
||||
gpio_write_pin(LED_SCROLL_LOCK_PIN, led_state.scroll_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
gpio_write_pin(INDICATOR_PIN_0, layer_state_cmp(state, 1));
|
||||
return state;
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
"resync": true
|
||||
}
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "D2",
|
||||
"on_state": 0
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["D5", "D3", "D4", "B1", "D6", "D7", "B4", "B5", "F7", "F6", "F5", "F4", "F1", "F0"],
|
||||
"rows": ["C7", "C6", "B6", "B0", "D1", "D0"]
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
/* Copyright 2020 Yiancar-Designs
|
||||
*
|
||||
* 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(D2);
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
// gpio_write_pin sets the pin high for 1 and low for 0.
|
||||
// In this example the pins are inverted, setting
|
||||
// it low/0 turns it on, and high/1 turns the LED off.
|
||||
// This behavior depends on whether the LED is between the pin
|
||||
// and VCC or the pin and GND.
|
||||
gpio_write_pin(D2, !led_state.caps_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -17,6 +17,11 @@
|
|||
"mousekey": true,
|
||||
"nkro": true
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "F1",
|
||||
"num_lock": "F0",
|
||||
"scroll_lock": "F4"
|
||||
},
|
||||
"qmk": {
|
||||
"locking": {
|
||||
"enabled": true,
|
||||
|
|
|
@ -22,21 +22,3 @@ void keyboard_pre_init_kb(void) {
|
|||
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
gpio_set_pin_output(F0);
|
||||
gpio_set_pin_output(F1);
|
||||
gpio_set_pin_output(F4);
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if (res) {
|
||||
gpio_write_pin(F0, led_state.num_lock);
|
||||
gpio_write_pin(F1, led_state.caps_lock);
|
||||
gpio_write_pin(F4, led_state.scroll_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@
|
|||
"resync": true
|
||||
}
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "F1"
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["B7", "B0", "F5", "D5", "B1", "B2", "B3", "D3", "D2", "C7", "C6", "B6", "B5", "B4", "D7", "D6", "D4"],
|
||||
"rows": ["F0", "E6", "F4", "F6", "F7"]
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/* Copyright 2018 Jason Williams (Wilba)
|
||||
*
|
||||
* 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(F1);
|
||||
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (led_update_user(led_state)) {
|
||||
gpio_write_pin(F1, led_state.caps_lock);
|
||||
}
|
||||
return true;
|
||||
}
|
|
@ -8,6 +8,9 @@
|
|||
"pid": "0x001F",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "F1"
|
||||
},
|
||||
"rgblight": {
|
||||
"saturation_steps": 8,
|
||||
"brightness_steps": 8,
|
||||
|
|
|
@ -17,19 +17,6 @@
|
|||
|
||||
bool g_first_execution = false;
|
||||
|
||||
void keyboard_pre_init_kb(void) {
|
||||
gpio_set_pin_output(F1);
|
||||
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if (led_update_user(led_state)) {
|
||||
gpio_write_pin(F1, led_state.caps_lock);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// This is some magic so that PCBs flashed with VIA firmware at the factory
|
||||
// will start with an RGB test pattern. Not relevant for non-VIA firmware.
|
||||
#ifdef VIA_ENABLE
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/* Copyright 2020 wuquestudio
|
||||
*
|
||||
* 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 matrix_init_kb(void) {
|
||||
gpio_set_pin_output(C6);
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if(res) {
|
||||
gpio_write_pin(C6, !led_state.caps_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
|
@ -8,6 +8,10 @@
|
|||
"pid": "0x0003",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "C6",
|
||||
"on_state": 0
|
||||
},
|
||||
"ws2812": {
|
||||
"pin": "E2"
|
||||
},
|
||||
|
|
|
@ -32,6 +32,10 @@
|
|||
"pin": "B7",
|
||||
"levels": 5
|
||||
},
|
||||
"indicators": {
|
||||
"caps_lock": "F4",
|
||||
"on_state": 0
|
||||
},
|
||||
"ws2812": {
|
||||
"pin": "E2"
|
||||
},
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#include "quantum.h"
|
||||
|
||||
__attribute__((weak))
|
||||
void matrix_init_kb(void){
|
||||
gpio_set_pin_output(F4);
|
||||
gpio_write_pin_high(F4);
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
bool led_update_kb(led_t led_state) {
|
||||
bool res = led_update_user(led_state);
|
||||
if (res) {
|
||||
// gpio_write_pin sets the pin high for 1 and low for 0.
|
||||
// In this example the pins are inverted, setting
|
||||
// it low/0 turns it on, and high/1 turns the LED off.
|
||||
// This behavior depends on whether the LED is between the pin
|
||||
// and VCC or the pin and GND.
|
||||
gpio_write_pin(F4, !led_state.caps_lock);
|
||||
}
|
||||
return res;
|
||||
}
|
Loading…
Reference in New Issue
Block a user