qmk_firmware

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

numpad.c (2920B)


      1 /* Copyright 2021 Glorious, LLC <salman@pcgamingrace.com>
      2  * Modified 2022 by rustedaperture for qmk_firmware
      3  *
      4  * This program is free software: you can redistribute it and/or modify
      5  * it under the terms of the GNU General Public License as published by
      6  * the Free Software Foundation, either version 2 of the License, or
      7  * (at your option) any later version.
      8  *
      9  * This program is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     12  * GNU General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU General Public License
     15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     16  */
     17 
     18 #include "quantum.h"
     19 
     20 #ifdef RGB_MATRIX_ENABLE
     21 
     22 const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT] = {
     23 /* Refer to AW20216S manual for these locations
     24  *   driver
     25  *   |     R location
     26  *   |     |          G location
     27  *   |     |          |          B location
     28  *   |     |          |          | */
     29     {0, SW1_CS4,  SW1_CS5,  SW1_CS6  },  //  0  NUM
     30     {0, SW2_CS4,  SW2_CS5,  SW2_CS6  },  //  1  /
     31     {0, SW1_CS7,  SW1_CS8,  SW1_CS9  },  //  2  *
     32     {0, SW2_CS7,  SW2_CS8,  SW2_CS9  },  //  3  -
     33     {0, SW3_CS4,  SW3_CS5,  SW3_CS6  },  //  4  7
     34     {0, SW4_CS4,  SW4_CS5,  SW4_CS6  },  //  5  8
     35     {0, SW3_CS7,  SW3_CS8,  SW3_CS9  },  //  6  9
     36     {0, SW4_CS7,  SW4_CS8,  SW4_CS9  },  //  7  +
     37     {0, SW5_CS4,  SW5_CS5,  SW5_CS6  },  //  8  4
     38     {0, SW6_CS4,  SW6_CS5,  SW6_CS6  },  //  9  5
     39     {0, SW5_CS7,  SW5_CS8,  SW5_CS9  },  //  10 6
     40     {0, SW7_CS4,  SW7_CS5,  SW7_CS6  },  //  11 1
     41     {0, SW8_CS4,  SW8_CS5,  SW8_CS6  },  //  12 2
     42     {0, SW7_CS7,  SW7_CS8,  SW7_CS9  },  //  13 3
     43     {0, SW8_CS7,  SW8_CS8,  SW8_CS9  },  //  14 ENTER
     44     {0, SW9_CS4,  SW9_CS5,  SW9_CS6  },  //  15 0
     45     {0, SW9_CS7,  SW9_CS8,  SW9_CS9  },  //  16 .
     46     {0, SW1_CS1,  SW1_CS2,  SW1_CS3  },  //  17 LED18
     47     {0, SW2_CS1,  SW2_CS2,  SW2_CS3  },  //  18 LED19
     48     {0, SW3_CS1,  SW3_CS2,  SW3_CS3  },  //  19 LED20
     49     {0, SW4_CS1,  SW4_CS2,  SW4_CS3  },  //  20 LED21
     50     {0, SW5_CS1,  SW5_CS2,  SW5_CS3  },  //  21 LED22
     51     {0, SW6_CS1,  SW6_CS2,  SW6_CS3  },  //  22 LED23
     52     {0, SW7_CS1,  SW7_CS2,  SW7_CS3  },  //  23 LED24
     53     {0, SW1_CS10, SW1_CS11, SW1_CS12 },  //  24 LED27
     54     {0, SW2_CS10, SW2_CS11, SW2_CS12 },  //  25 LED28
     55     {0, SW3_CS10, SW3_CS11, SW3_CS12 },  //  26 LED29
     56     {0, SW4_CS10, SW4_CS11, SW4_CS12 },  //  27 LED30
     57     {0, SW5_CS10, SW5_CS11, SW5_CS12 },  //  28 LED31
     58     {0, SW6_CS10, SW6_CS11, SW6_CS12 },  //  29 LED32
     59     {0, SW7_CS10, SW7_CS11, SW7_CS12 },  //  30 LED33
     60 };
     61 
     62 #    ifdef AW20216S_PW_EN_PIN
     63 
     64 void keyboard_pre_init_kb(void) {
     65     wait_ms(2000);
     66     gpio_set_pin_output(AW20216S_PW_EN_PIN);
     67     gpio_write_pin_high(AW20216S_PW_EN_PIN);
     68 
     69     keyboard_pre_init_user();
     70 }
     71 #    endif
     72 
     73 #endif