3x5.c 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 "3x5.h"
  20. // clang-format off
  21. #ifdef RGB_MATRIX_ENABLE
  22. /**
  23. * \brief LEDs index.
  24. *
  25. * ╭────────────────────╮ ╭────────────────────╮
  26. * 2 3 8 9 12 30 27 26 21 20
  27. * ├────────────────────┤ ├────────────────────┤
  28. * 1 4 7 10 13 31 28 25 22 19
  29. * ├────────────────────┤ ├────────────────────┤
  30. * 0 5 6 11 14 32 29 24 23 18
  31. * ╰────────────────────╯ ╰────────────────────╯
  32. * 15 16 17 33 34 XX
  33. * ╰────────────╯ ╰────────────╯
  34. */
  35. led_config_t g_led_config = { {
  36. /* Key Matrix to LED index. */
  37. // Left split.
  38. { 2, 3, 8, 9, 12 }, // Top row
  39. { 1, 4, 7, 10, 13 }, // Middle row
  40. { 0, 5, 6, 11, 14 }, // Bottom row
  41. { 17, NO_LED, 15, 16, NO_LED }, // Thumb cluster
  42. // Right split.
  43. { 20, 21, 26, 27, 30 }, // Top row
  44. { 19, 22, 25, 28, 31 }, // Middle row
  45. { 18, 23, 24, 29, 32 }, // Bottom row
  46. { 33, NO_LED, 34, NO_LED, NO_LED }, // Thumb cluster
  47. }, {
  48. /* LED index to physical position. */
  49. // Left split.
  50. /* index=0 */ { 0, 42 }, { 0, 21 }, { 0, 0 }, // col 1 (left most)
  51. /* index=3 */ { 18, 0 }, { 18, 21 }, { 18, 42 }, // col 2
  52. /* index=6 */ { 36, 42 }, { 36, 21 }, { 36, 0 },
  53. /* index=9 */ { 54, 0 }, { 54, 21 }, { 54, 42 },
  54. /* index=12 */ { 72, 0 }, { 72, 21 }, { 72, 42 },
  55. /* index=15 */ { 72, 64 }, { 90, 64 }, { 108, 64 }, // Thumb cluster
  56. // Right split.
  57. /* index=18 */ { 224, 42 }, { 224, 21 }, { 224, 0 }, // col 10 (right most)
  58. /* index=21 */ { 206, 0 }, { 206, 21 }, { 206, 42 }, // col 9
  59. /* index=24 */ { 188, 42 }, { 188, 21 }, { 188, 0 },
  60. /* index=27 */ { 170, 0 }, { 170, 21 }, { 170, 42 },
  61. /* index=30 */ { 152, 0 }, { 152, 21 }, { 152, 42 },
  62. /* index=33 */ { 152, 64 }, { 134, 64 },
  63. }, {
  64. /* LED index to flag. */
  65. // Left split.
  66. /* index=0 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 1
  67. /* index=3 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 2
  68. /* index=6 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  69. /* index=9 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  70. /* index=12 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  71. /* index=15 */ LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, LED_FLAG_MODIFIER, // Thumb cluster
  72. // Right split.
  73. /* index=18 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 10
  74. /* index=21 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // col 9
  75. /* index=24 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  76. /* index=27 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  77. /* index=30 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT,
  78. /* index=33 */ LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // Thumb cluster
  79. } };
  80. #endif
  81. // clang-format on