numpad.c 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. #include "quantum.h"
  18. #ifdef RGB_MATRIX_ENABLE
  19. const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT] = {
  20. /* Refer to AW20216S manual for these locations
  21. * driver
  22. * | R location
  23. * | | G location
  24. * | | | B location
  25. * | | | | */
  26. {0, SW1_CS4, SW1_CS5, SW1_CS6 }, // 0 NUM
  27. {0, SW2_CS4, SW2_CS5, SW2_CS6 }, // 1 /
  28. {0, SW1_CS7, SW1_CS8, SW1_CS9 }, // 2 *
  29. {0, SW2_CS7, SW2_CS8, SW2_CS9 }, // 3 -
  30. {0, SW3_CS4, SW3_CS5, SW3_CS6 }, // 4 7
  31. {0, SW4_CS4, SW4_CS5, SW4_CS6 }, // 5 8
  32. {0, SW3_CS7, SW3_CS8, SW3_CS9 }, // 6 9
  33. {0, SW4_CS7, SW4_CS8, SW4_CS9 }, // 7 +
  34. {0, SW5_CS4, SW5_CS5, SW5_CS6 }, // 8 4
  35. {0, SW6_CS4, SW6_CS5, SW6_CS6 }, // 9 5
  36. {0, SW5_CS7, SW5_CS8, SW5_CS9 }, // 10 6
  37. {0, SW7_CS4, SW7_CS5, SW7_CS6 }, // 11 1
  38. {0, SW8_CS4, SW8_CS5, SW8_CS6 }, // 12 2
  39. {0, SW7_CS7, SW7_CS8, SW7_CS9 }, // 13 3
  40. {0, SW8_CS7, SW8_CS8, SW8_CS9 }, // 14 ENTER
  41. {0, SW9_CS4, SW9_CS5, SW9_CS6 }, // 15 0
  42. {0, SW9_CS7, SW9_CS8, SW9_CS9 }, // 16 .
  43. {0, SW1_CS1, SW1_CS2, SW1_CS3 }, // 17 LED18
  44. {0, SW2_CS1, SW2_CS2, SW2_CS3 }, // 18 LED19
  45. {0, SW3_CS1, SW3_CS2, SW3_CS3 }, // 19 LED20
  46. {0, SW4_CS1, SW4_CS2, SW4_CS3 }, // 20 LED21
  47. {0, SW5_CS1, SW5_CS2, SW5_CS3 }, // 21 LED22
  48. {0, SW6_CS1, SW6_CS2, SW6_CS3 }, // 22 LED23
  49. {0, SW7_CS1, SW7_CS2, SW7_CS3 }, // 23 LED24
  50. {0, SW1_CS10, SW1_CS11, SW1_CS12 }, // 24 LED27
  51. {0, SW2_CS10, SW2_CS11, SW2_CS12 }, // 25 LED28
  52. {0, SW3_CS10, SW3_CS11, SW3_CS12 }, // 26 LED29
  53. {0, SW4_CS10, SW4_CS11, SW4_CS12 }, // 27 LED30
  54. {0, SW5_CS10, SW5_CS11, SW5_CS12 }, // 28 LED31
  55. {0, SW6_CS10, SW6_CS11, SW6_CS12 }, // 29 LED32
  56. {0, SW7_CS10, SW7_CS11, SW7_CS12 }, // 30 LED33
  57. };
  58. # ifdef AW20216S_PW_EN_PIN
  59. void keyboard_pre_init_kb(void) {
  60. wait_ms(2000);
  61. gpio_set_pin_output(AW20216S_PW_EN_PIN);
  62. gpio_write_pin_high(AW20216S_PW_EN_PIN);
  63. keyboard_pre_init_user();
  64. }
  65. # endif
  66. #endif