logo

qmk_firmware

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

4x6.c (6297B)


  1. /*
  2. * Copyright 2020 Christopher Courtney <drashna@live.com> (@drashna)
  3. * Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
  4. * Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
  5. *
  6. * This program is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Publicw License as published by
  8. * the Free Software Foundation, either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include "charybdis.h"
  20. // clang-format off
  21. #ifdef RGB_MATRIX_ENABLE
  22. /**
  23. * \brief LEDs index.
  24. *
  25. * ╭────────────────────────╮ ╭────────────────────────╮
  26. * 0 7 8 15 16 20 49 45 44 37 36 29
  27. * ├────────────────────────┤ ├────────────────────────┤
  28. * 1 6 9 14 17 21 50 46 43 38 35 30
  29. * ├────────────────────────┤ ├────────────────────────┤
  30. * 2 5 10 13 18 22 51 47 42 39 34 31
  31. * ├────────────────────────┤ ├────────────────────────┤
  32. * 3 4 11 12 19 23 52 48 41 40 33 32
  33. * ╰────────────────────────╯ ╰────────────────────────╯
  34. * 26 27 28 53 54 XX
  35. * 25 24 55 XX
  36. * ╰────────────╯ ╰────────────╯
  37. *
  38. * Note: the LED config simulates 58 LEDs instead of the actual 56 to prevent
  39. * confusion when testing LEDs during assembly when handedness is not set
  40. * correctly. Those fake LEDs are bound to the physical bottom-left corner.
  41. */
  42. led_config_t g_led_config = { {
  43. /* Key Matrix to LED index. */
  44. // Left split.
  45. { 0, 7, 8, 15, 16, 20 }, // Num row
  46. { 1, 6, 9, 14, 17, 21 }, // Top row
  47. { 2, 5, 10, 13, 18, 22 }, // Middle row
  48. { 3, 4, 11, 12, 19, 23 }, // Bottom row
  49. { NO_LED, 28, 24, 26, 27, 25 }, // Thumb cluster
  50. // Right split.
  51. { 29, 36, 37, 44, 45, 49 }, // Num row
  52. { 30, 35, 38, 43, 46, 50 }, // Top row
  53. { 31, 34, 39, 42, 47, 51 }, // Middle row
  54. { 32, 33, 40, 41, 48, 52 }, // Bottom row
  55. { NO_LED, 53, 55, 54, NO_LED, NO_LED }, // Thumb cluster
  56. }, {
  57. /* LED index to physical position. */
  58. // Left split.
  59. /* index=0 */ { 0, 0 }, { 0, 12 }, { 0, 24 }, { 0, 36 }, // col 1 (left most)
  60. /* index=4 */ { 16, 36 }, { 16, 24 }, { 16, 12 }, { 16, 0 }, // col 2
  61. /* index=8 */ { 32, 0 }, { 32, 12 }, { 32, 24 }, { 32, 36 },
  62. /* index=12 */ { 48, 36 }, { 48, 24 }, { 48, 12 }, { 48, 0 },
  63. /* index=16 */ { 64, 0 }, { 64, 12 }, { 64, 24 }, { 64, 36 },
  64. /* index=20 */ { 80, 0 }, { 80, 12 }, { 80, 24 }, { 80, 36 },
  65. /* index=24 */ { 112, 64 }, { 96, 64 }, { 80, 52 },
  66. /* index=27 */ { 96, 52 }, { 112, 52 },
  67. // Right split.
  68. /* index=29 */ { 224, 0 }, { 224, 12 }, { 224, 24 }, { 224, 36 }, // col 12 (right most)
  69. /* index=33 */ { 208, 36 }, { 208, 24 }, { 208, 12 }, { 208, 0 }, // col 11
  70. /* index=37 */ { 192, 0 }, { 192, 12 }, { 192, 24 }, { 192, 36 },
  71. /* index=41 */ { 176, 36 }, { 176, 24 }, { 176, 12 }, { 176, 0 },
  72. /* index=45 */ { 160, 0 }, { 160, 12 }, { 160, 24 }, { 160, 36 },
  73. /* index=49 */ { 144, 0 }, { 144, 12 }, { 144, 24 }, { 144, 36 },
  74. /* index=53 */ { 112, 52 }, { 128, 64 }, { 112, 64 },
  75. /* index=56 */ { 0, 0 }, { 0, 0 },
  76. }, {
  77. /* LED index to flag. */
  78. // Left split.
  79. /* index=0 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 1
  80. /* index=4 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 2
  81. /* index=8 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  82. /* index=12 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  83. /* index=16 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  84. /* index=20 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  85. /* index=24 */ LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, // Thumb cluster top
  86. /* index=27 */ LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, // Thumb cluster bottom
  87. // Right split.
  88. /* index=29 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 12
  89. /* index=33 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 11
  90. /* index=37 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  91. /* index=41 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  92. /* index=45 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  93. /* index=49 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  94. /* index=53 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // Thumb cluster
  95. /* index=55 */ LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, // Thumb cluster fakes
  96. } };
  97. #endif
  98. // clang-format on