qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

xd75.c (1637B)


      1 /* Copyright 2017 Benjamin Kesselring
      2  *
      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.
      7  *
      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.
     12  *
     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/>.
     15  */
     16 
     17 #include "xd75.h"
     18 
     19 #define XD75_CAPSLOCK_LED B2
     20 #define XD75_GP103_LED F4
     21 #define XD75_GP100_LED F7
     22 
     23 void matrix_init_kb(void) {
     24     capslock_led_init();
     25     gp100_led_init();
     26     gp103_led_init();
     27 
     28     matrix_init_user();
     29 }
     30 
     31 void capslock_led_init(void) {
     32     gpio_set_pin_output(XD75_CAPSLOCK_LED);
     33     capslock_led_off();
     34 }
     35 
     36 void capslock_led_off(void) {
     37     gpio_write_pin_high(XD75_CAPSLOCK_LED);
     38 }
     39 
     40 void capslock_led_on(void) {
     41     gpio_write_pin_low(XD75_CAPSLOCK_LED);
     42 }
     43 
     44 void gp100_led_init(void) {
     45     gpio_set_pin_output(XD75_GP100_LED);
     46     gp100_led_off();
     47 }
     48 
     49 void gp100_led_off(void) {
     50     gpio_write_pin_high(XD75_GP100_LED);
     51 }
     52 
     53 void gp100_led_on(void) {
     54     gpio_write_pin_low(XD75_GP100_LED);
     55 }
     56 
     57 void gp103_led_init(void) {
     58     gpio_set_pin_output(XD75_GP103_LED);
     59     gp103_led_off();
     60 }
     61 
     62 void gp103_led_off(void) {
     63     gpio_write_pin_low(XD75_GP103_LED);
     64 }
     65 
     66 void gp103_led_on(void) {
     67     gpio_write_pin_high(XD75_GP103_LED);
     68 }