1 /* Copyright 2017 Benjamin Kesselring
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #define XD75_CAPSLOCK_LED 2 // B2
19 #define XD75_GP103_LED 4 // F4
20 #define XD75_KEYCAPS_LED 5 // F5
21 #define XD75_GP100_LED 7 // F7
23 void matrix_init_kb(void) {
24 // put your keyboard start-up code here
25 // runs once when the firmware starts up
35 void matrix_scan_kb(void) {
36 // put your looping keyboard code here
37 // runs every cycle (a lot)
42 bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
43 // put your per-action keyboard code here
44 // runs for every action, just before processing by the firmware
46 return process_record_user(keycode, record);
49 void led_set_kb(uint8_t usb_led) {
50 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
52 led_set_user(usb_led);
55 void capslock_led_init(void) {
56 DDRB |= (1 << XD75_CAPSLOCK_LED);
60 void capslock_led_off(void) {
61 PORTB |= (1 << XD75_CAPSLOCK_LED);
64 void capslock_led_on(void) {
65 PORTB &= ~(1 << XD75_CAPSLOCK_LED);
68 void gp100_led_init(void) {
69 DDRF |= (1 << XD75_GP100_LED);
73 void gp100_led_off(void) {
74 PORTF |= (1 << XD75_GP100_LED);
77 void gp100_led_on(void) {
78 PORTF &= ~(1 << XD75_GP100_LED);
81 void gp103_led_init(void) {
82 DDRF |= (1 << XD75_GP103_LED);
86 void gp103_led_off(void) {
87 PORTF &= ~(1 << XD75_GP103_LED);
90 void gp103_led_on(void) {
91 PORTF |= (1 << XD75_GP103_LED);
94 void keycaps_led_init(void) {
95 DDRF |= (1 << XD75_KEYCAPS_LED);
99 void keycaps_led_off(void) {
100 PORTF |= (1 << XD75_KEYCAPS_LED);
103 void keycaps_led_on(void) {
104 PORTF &= ~(1 << XD75_KEYCAPS_LED);