qmk_firmware

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

big_led.c (2012B)


      1 /* Copyright 2021 Jay Greco
      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 #include "big_led.h"
     17 
     18 void set_big_LED_rgb(uint8_t r_mode, uint8_t g_mode, uint8_t b_mode) {
     19     set_big_LED_r(r_mode);
     20     set_big_LED_g(g_mode);
     21     set_big_LED_b(b_mode);
     22 }
     23 
     24 void set_big_LED_r(uint8_t mode) {
     25     switch(mode) {
     26         case LED_ON:
     27             gpio_set_pin_output(BIG_LED_R_PIN);
     28             gpio_write_pin(BIG_LED_R_PIN, GPIO_STATE_HIGH);
     29         break;
     30 
     31         case LED_OFF:
     32             gpio_set_pin_output(BIG_LED_R_PIN);
     33             gpio_write_pin(BIG_LED_R_PIN, GPIO_STATE_LOW);
     34         break;
     35 
     36         default:
     37         break;
     38     }
     39 }
     40 
     41 void set_big_LED_g(uint8_t mode) {
     42     switch(mode) {
     43         case LED_ON:
     44             gpio_set_pin_output(BIG_LED_G_PIN);
     45             gpio_write_pin(BIG_LED_G_PIN, GPIO_STATE_HIGH);
     46         break;
     47 
     48         case LED_OFF:
     49             gpio_set_pin_output(BIG_LED_G_PIN);
     50             gpio_write_pin(BIG_LED_G_PIN, GPIO_STATE_LOW);
     51         break;
     52 
     53         default:
     54         break;
     55     }
     56 }
     57 
     58 void set_big_LED_b(uint8_t mode) {
     59     switch(mode) {
     60         case LED_ON:
     61             gpio_set_pin_output(BIG_LED_B_PIN);
     62             gpio_write_pin(BIG_LED_B_PIN, GPIO_STATE_HIGH);
     63         break;
     64 
     65         case LED_OFF:
     66             gpio_set_pin_output(BIG_LED_B_PIN);
     67             gpio_write_pin(BIG_LED_B_PIN, GPIO_STATE_LOW);
     68         break;
     69 
     70         default:
     71         break;
     72     }
     73 }