solderable.c (2213B)
1 /* Copyright 2021 datafx 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 "solderable.h" 18 19 #define noLed {255,255} 20 21 #define ledSollSP (80+3) 22 #define ledNumSP (80+7) 23 #define ledCapSP (80+8) 24 25 void backlight_init_ports(void) { 26 gpio_set_pin_output(Lseg0); 27 gpio_set_pin_output(Lseg1); 28 gpio_set_pin_output(Lseg2); 29 gpio_set_pin_output(Lseg3); 30 gpio_set_pin_output(Lseg4); 31 gpio_set_pin_output(Lseg5); 32 gpio_set_pin_output(Lcom0); 33 gpio_set_pin_output(Lcom1); 34 gpio_set_pin_output(Lcom2); 35 gpio_set_pin_output(Lcom3); 36 gpio_set_pin_output(Lcom4); 37 gpio_set_pin_output(Lcom5); 38 gpio_set_pin_output(Lcom6); 39 gpio_set_pin_output(Lcom7); 40 gpio_set_pin_output(Lcom8); 41 gpio_set_pin_output(Lcom9); 42 gpio_set_pin_output(Lcom10); 43 gpio_set_pin_output(Lcom11); 44 gpio_set_pin_output(Lcom12); 45 gpio_set_pin_output(Lcom13); 46 gpio_set_pin_output(Lcom14); 47 gpio_set_pin_output(Lcom15); 48 } 49 50 void backlight_set(uint8_t level) { 51 } 52 53 void backlight_task(void) { 54 // This is a temporary workaround to get the status LEDs working until we can figure out the LED matrix 55 led_t host_leds = host_keyboard_led_state(); 56 if (host_leds.scroll_lock) { 57 gpio_write_pin_high(Lcom3); 58 gpio_write_pin_high(Lseg5); 59 } else { 60 gpio_write_pin_low(Lcom3); 61 } 62 if (host_leds.num_lock) { 63 gpio_write_pin_high(Lcom7); 64 gpio_write_pin_high(Lseg5); 65 } else { 66 gpio_write_pin_low(Lcom7); 67 } 68 if (host_leds.caps_lock) { 69 gpio_write_pin_high(Lcom8); 70 gpio_write_pin_high(Lseg5); 71 } else { 72 gpio_write_pin_low(Lcom8); 73 } 74 } 75