logo

qmk_firmware

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

rgb.c (5906B)


  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. #include "quantum.h"
  17. led_config_t g_led_config = { {
  18. // esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 prtscr scrl brk
  19. { 91, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109 },
  20. //tilde 1 2 3 4 5 6 7 8 9 0 - = ins home pgup
  21. { 90, 89, 88, 87, 86, 85, 84, 83, 82, 81, 80, 79, 78, 76, 75, 74 },
  22. //tab q w e r t y u i o p [ ] del end pgdn
  23. { 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73 },
  24. //caps a s d f g h j k l ; ' return bspc
  25. { 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 77, NO_LED, NO_LED },
  26. //lshift z x c v b n m , . / rshift bsls up rctl
  27. { 31, NO_LED, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 70, 43, 23 },
  28. //ctrl win alt space alt win mod left down right
  29. { 30, 29, 28, NO_LED, NO_LED, NO_LED, 27, NO_LED, NO_LED, NO_LED, 26, 25, 24, 22, 21, 20 },
  30. //underglow lights
  31. //{ 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 },
  32. //{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
  33. }, {
  34. // Underglow lights
  35. { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 }, { 254, 63 },
  36. // right down left rctl mod rwin ralt space lalt lwin lctl
  37. { 225, 63 }, { 215, 63 }, { 206, 63 }, { 180, 63 }, { 168, 63}, { 153, 63 }, { 135, 63 }, { 101, 63 }, { 33, 63 }, { 22, 63 }, { 0, 63 },
  38. // lshift z x c v b n m comma period question rshift up
  39. { 0, 48 }, { 30, 48 }, { 45, 48 }, { 60, 48 }, { 75, 48 }, { 90, 48 }, { 105, 48 }, { 120, 48 }, { 135, 48 }, { 150, 48 }, { 165, 48 }, { 198, 48 }, { 215, 48},
  40. // return ' ; l k j h g f d s a capslock
  41. { 198, 36 }, { 180, 36 }, { 176, 36 }, { 161, 36 }, { 146, 36 }, { 131, 36 }, { 116, 36 }, { 101, 36 }, { 86, 36 }, { 71, 36 }, { 56, 36 }, { 41, 36 }, { 0, 36 },
  42. // tab q w e r t y u i o p [ ] backslash del end pgdn
  43. { 0, 24 }, { 22, 24}, { 37, 24 }, { 52, 24 }, { 67, 24 }, { 82, 24 }, { 97, 24 }, { 112, 24 }, { 127, 24 }, { 142, 24 }, { 157, 24 }, { 172, 24 }, { 187, 24 }, { 202, 24}, { 206, 24 }, {215, 24}, { 225, 24 },
  44. // pgup home ins backspace = - 0 9 8 7 6 5 4 3 2 1 tilde
  45. { 225, 12 }, {215, 12}, { 206, 12 }, { 202, 12}, { 187, 12 }, { 172, 12 }, { 157, 12 }, { 142, 12 }, { 127, 12 }, { 112, 12 }, { 97, 12 }, { 82, 12 }, { 67, 12 }, { 52, 12 }, { 37, 12 }, { 22, 12}, { 0, 12 },
  46. // esc ind1 ind2 ind3 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 prtscr scrlck pause
  47. { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 25, 0 }, { 40, 0 }, { 55, 0 }, { 82, 0 }, { 108, 0 }, { 120, 0 }, { 130, 0 }, { 148, 0 }, { 172, 0 }, { 187, 0 }, { 190, 0 }, { 195, 0 }, { 206, 0 }, { 215, 0}, { 225, 0 }
  48. }, {
  49. // underglow
  50. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
  51. // bottom row
  52. 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1,
  53. // 2nd row up
  54. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
  55. // 3rd row up
  56. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
  57. // 4th row up
  58. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1, 1,
  59. // 5th row up
  60. 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
  61. // top row
  62. 1, 8, 8, 8, 4, 4, 4, 4, 1, 1, 1, 1, 4, 4, 4, 4, 1, 1, 1
  63. } };
  64. bool rgb_matrix_indicators_kb(void) {
  65. if (!rgb_matrix_indicators_user()) {
  66. return false;
  67. }
  68. led_t host_leds = host_keyboard_led_state();
  69. if (host_leds.scroll_lock) {
  70. rgb_matrix_set_color(92, 0xFF, 0x0, 0x0);
  71. } else {
  72. rgb_matrix_set_color(92, 0x0, 0x0, 0x0);
  73. }
  74. if (host_leds.num_lock) {
  75. rgb_matrix_set_color(93, 0xFF, 0x0, 0x0);
  76. } else {
  77. rgb_matrix_set_color(93, 0x0, 0x0, 0x0);
  78. }
  79. if (host_leds.caps_lock) {
  80. rgb_matrix_set_color(94, 0xFF, 0x0, 0x0);
  81. } else {
  82. rgb_matrix_set_color(94, 0x0, 0x0, 0x0);
  83. }
  84. return true;
  85. }