logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

numpad.c (4101B)


  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. led_config_t g_led_config = {{
  59. { 0, 1, 2, 3 },
  60. { 4, 5, 6, 7 },
  61. { 8, 9, 10, NO_LED},
  62. { 11, 12, 13, 14 },
  63. { 15, NO_LED, NO_LED, 16 }
  64. }, {
  65. {45, 0 }, // 0 NUM
  66. {90, 0 }, // 1 /
  67. {134, 0 }, // 2 *
  68. {179, 0 }, // 3 -
  69. {45, 16 }, // 4 7
  70. {90, 16 }, // 5 8
  71. {134, 16 }, // 6 9
  72. {179, 24 }, // 7 +
  73. {45, 32 }, // 8 4
  74. {90, 32 }, // 9 5
  75. {134, 32 }, // 10 6
  76. {45, 48 }, // 11 1
  77. {90, 48 }, // 12 2
  78. {134, 48 }, // 13 3
  79. {179, 56 }, // 14 ENTER
  80. {67, 64 }, // 15 0
  81. {134, 64 }, // 16 .
  82. {0, 0 }, // 17 LED18
  83. {0, 11 }, // 18 LED19
  84. {0, 21 }, // 19 LED20
  85. {0, 32 }, // 20 LED21
  86. {0, 43 }, // 21 LED22
  87. {0, 53 }, // 22 LED23
  88. {0, 64 }, // 23 LED24
  89. {224, 0 }, // 24 LED27
  90. {224, 11 }, // 25 LED28
  91. {224, 21 }, // 26 LED29
  92. {224, 32 }, // 27 LED30
  93. {224, 43 }, // 28 LED31
  94. {224, 53 }, // 29 LED32
  95. {224, 64 } // 30 LED33
  96. }, {
  97. 4, 4, 4, 4,
  98. 4, 4, 4, 4,
  99. 4, 4, 4,
  100. 4, 4, 4, 4,
  101. 4, 4,
  102. 2, 2, 2, 2, 2, 2, 2,
  103. 2, 2, 2, 2, 2, 2, 2
  104. } };
  105. # ifdef AW20216S_PW_EN_PIN
  106. void keyboard_pre_init_kb(void) {
  107. wait_ms(2000);
  108. gpio_set_pin_output(AW20216S_PW_EN_PIN);
  109. gpio_write_pin_high(AW20216S_PW_EN_PIN);
  110. keyboard_pre_init_user();
  111. }
  112. # endif
  113. #endif