logo

qmk_firmware

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

rgb_matrix_drivers.c (5259B)


  1. /* Copyright 2018 James Laird-Wah
  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 "rgb_matrix_drivers.h"
  17. #include <stdbool.h>
  18. #include "keyboard.h"
  19. #include "color.h"
  20. #include "util.h"
  21. /* Each driver needs to define the struct
  22. * const rgb_matrix_driver_t rgb_matrix_driver;
  23. * All members must be provided.
  24. * Keyboard custom drivers can define this in their own files, it should only
  25. * be here if shared between boards.
  26. */
  27. #if defined(RGB_MATRIX_IS31FL3218)
  28. const rgb_matrix_driver_t rgb_matrix_driver = {
  29. .init = is31fl3218_init,
  30. .flush = is31fl3218_update_pwm_buffers,
  31. .set_color = is31fl3218_set_color,
  32. .set_color_all = is31fl3218_set_color_all,
  33. };
  34. #elif defined(RGB_MATRIX_IS31FL3236)
  35. const rgb_matrix_driver_t rgb_matrix_driver = {
  36. .init = is31fl3236_init_drivers,
  37. .flush = is31fl3236_flush,
  38. .set_color = is31fl3236_set_color,
  39. .set_color_all = is31fl3236_set_color_all,
  40. };
  41. #elif defined(RGB_MATRIX_IS31FL3729)
  42. const rgb_matrix_driver_t rgb_matrix_driver = {
  43. .init = is31fl3729_init_drivers,
  44. .flush = is31fl3729_flush,
  45. .set_color = is31fl3729_set_color,
  46. .set_color_all = is31fl3729_set_color_all,
  47. };
  48. #elif defined(RGB_MATRIX_IS31FL3731)
  49. const rgb_matrix_driver_t rgb_matrix_driver = {
  50. .init = is31fl3731_init_drivers,
  51. .flush = is31fl3731_flush,
  52. .set_color = is31fl3731_set_color,
  53. .set_color_all = is31fl3731_set_color_all,
  54. };
  55. #elif defined(RGB_MATRIX_IS31FL3733)
  56. const rgb_matrix_driver_t rgb_matrix_driver = {
  57. .init = is31fl3733_init_drivers,
  58. .flush = is31fl3733_flush,
  59. .set_color = is31fl3733_set_color,
  60. .set_color_all = is31fl3733_set_color_all,
  61. };
  62. #elif defined(RGB_MATRIX_IS31FL3736)
  63. const rgb_matrix_driver_t rgb_matrix_driver = {
  64. .init = is31fl3736_init_drivers,
  65. .flush = is31fl3736_flush,
  66. .set_color = is31fl3736_set_color,
  67. .set_color_all = is31fl3736_set_color_all,
  68. };
  69. #elif defined(RGB_MATRIX_IS31FL3737)
  70. const rgb_matrix_driver_t rgb_matrix_driver = {
  71. .init = is31fl3737_init_drivers,
  72. .flush = is31fl3737_flush,
  73. .set_color = is31fl3737_set_color,
  74. .set_color_all = is31fl3737_set_color_all,
  75. };
  76. #elif defined(RGB_MATRIX_IS31FL3741)
  77. const rgb_matrix_driver_t rgb_matrix_driver = {
  78. .init = is31fl3741_init_drivers,
  79. .flush = is31fl3741_flush,
  80. .set_color = is31fl3741_set_color,
  81. .set_color_all = is31fl3741_set_color_all,
  82. };
  83. #elif defined(RGB_MATRIX_IS31FL3742A)
  84. const rgb_matrix_driver_t rgb_matrix_driver = {
  85. .init = is31fl3742a_init_drivers,
  86. .flush = is31fl3742a_flush,
  87. .set_color = is31fl3742a_set_color,
  88. .set_color_all = is31fl3742a_set_color_all,
  89. };
  90. #elif defined(RGB_MATRIX_IS31FL3743A)
  91. const rgb_matrix_driver_t rgb_matrix_driver = {
  92. .init = is31fl3743a_init_drivers,
  93. .flush = is31fl3743a_flush,
  94. .set_color = is31fl3743a_set_color,
  95. .set_color_all = is31fl3743a_set_color_all,
  96. };
  97. #elif defined(RGB_MATRIX_IS31FL3745)
  98. const rgb_matrix_driver_t rgb_matrix_driver = {
  99. .init = is31fl3745_init_drivers,
  100. .flush = is31fl3745_flush,
  101. .set_color = is31fl3745_set_color,
  102. .set_color_all = is31fl3745_set_color_all,
  103. };
  104. #elif defined(RGB_MATRIX_IS31FL3746A)
  105. const rgb_matrix_driver_t rgb_matrix_driver = {
  106. .init = is31fl3746a_init_drivers,
  107. .flush = is31fl3746a_flush,
  108. .set_color = is31fl3746a_set_color,
  109. .set_color_all = is31fl3746a_set_color_all,
  110. };
  111. #elif defined(RGB_MATRIX_SNLED27351)
  112. const rgb_matrix_driver_t rgb_matrix_driver = {
  113. .init = snled27351_init_drivers,
  114. .flush = snled27351_flush,
  115. .set_color = snled27351_set_color,
  116. .set_color_all = snled27351_set_color_all,
  117. };
  118. #elif defined(RGB_MATRIX_AW20216S)
  119. const rgb_matrix_driver_t rgb_matrix_driver = {
  120. .init = aw20216s_init_drivers,
  121. .flush = aw20216s_flush,
  122. .set_color = aw20216s_set_color,
  123. .set_color_all = aw20216s_set_color_all,
  124. };
  125. #elif defined(RGB_MATRIX_WS2812)
  126. # if defined(RGBLIGHT_WS2812)
  127. # pragma message "Cannot use RGBLIGHT and RGB Matrix using WS2812 at the same time."
  128. # pragma message "You need to use a custom driver, or re-implement the WS2812 driver to use a different configuration."
  129. # endif
  130. const rgb_matrix_driver_t rgb_matrix_driver = {
  131. .init = ws2812_init,
  132. .flush = ws2812_flush,
  133. .set_color = ws2812_set_color,
  134. .set_color_all = ws2812_set_color_all,
  135. };
  136. #endif