logo

qmk_firmware

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

rev1.c (4783B)


  1. // Copyright 2022 Dane Skalski (@Daneski13)
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "quantum.h"
  4. // Hand swap
  5. #ifdef SWAP_HANDS_ENABLE
  6. __attribute__ ((weak))
  7. const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
  8. // Left
  9. {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}, {6, 5}},
  10. {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}, {6, 6}},
  11. {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}, {6, 7}},
  12. {{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}, {5, 8}, {6, 8}},
  13. {{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}, {5, 9}, {6, 9}},
  14. // Right
  15. {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}, {6, 0}},
  16. {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}, {6, 1}},
  17. {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}, {6, 2}},
  18. {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}, {6, 3}},
  19. {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}, {6, 4}}
  20. };
  21. #endif
  22. /* RGB LED matrix */
  23. #ifdef RGB_MATRIX_ENABLE
  24. /*
  25. Key Matrix Physical
  26. L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05,
  27. L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15,
  28. L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25,
  29. L30, L31, L32, L33, L34, L35, L45, R40, R30, R31, R32, R33, R34, R35,
  30. L40, L41, L42, L43, L44, R42, R41, R43, R44, R45
  31. Key Electrical
  32. Left:
  33. { L00, L01, L02, L03, L04, L05 },
  34. { L10, L11, L12, L13, L14, L15 },
  35. { L20, L21, L22, L23, L24, L25 },
  36. { L30, L31, L32, L33, L34, L35 },
  37. { L40, L41, L42, L43, L44, L45 },
  38. Right:
  39. { R05, R04, R03, R02, R01, R00 },
  40. { R15, R14, R13, R12, R11, R10 },
  41. { R25, R24, R23, R22, R21, R20 },
  42. { R35, R34, R33, R32, R31, R30 },
  43. { R45, R44, R43, R42, R41, R40 }
  44. Key matrix physical filled with LED electrical indexes, count starting at 1
  45. Col
  46. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 Row
  47. 14 13 12 11 10 9 46 47 48 49 50 51 0
  48. 6 7 8 45 44 43
  49. 15 16 17 18 19 20 57 56 55 54 53 52 1
  50. 26 25 24 23 22 21 58 59 60 61 62 63 2
  51. 5 4 3 40 41 42
  52. 27 28 29 30 31 32 NO NO 69 68 67 66 65 64 3
  53. 37 36 35 34 33 70 71 72 73 74 4
  54. 2 1 38 39
  55. */
  56. // clang-format off
  57. led_config_t g_led_config = {
  58. { // Key Electrical Matrix to LED Index (count start at 0, so 8 is the first non-underglow key)
  59. // Left Half
  60. { 13, 12, 11, 10, 9, 8 },
  61. { 14, 15, 16, 17, 18, 19 },
  62. { 25, 24, 23, 22, 21, 20 },
  63. { 26, 27, 28, 29, 30, 31 },
  64. { 36, 35, 34, 33, 32, NO_LED },
  65. // Right Half
  66. { 50, 49, 48, 47, 46, 45 },
  67. { 51, 52, 53, 54, 55, 56 },
  68. { 62, 61, 60, 59, 58, 57 },
  69. { 63, 64, 65, 66, 67, 68 },
  70. { 73, 72, 71, 70, 69, NO_LED }
  71. },
  72. { // LED Index to LED Physical Position (mirrored on right half)
  73. // Left Underglow (indicies 1 - 8)
  74. { 95, 72 }, { 52, 72 }, { 86, 40 }, { 52, 40 }, { 9, 40 }, { 9, 8 }, { 52, 8 }, { 86, 8 },
  75. // Left Matrix (indicies 9 - 37)
  76. { 86, 0 }, { 69, 0 }, { 52, 0 }, { 34, 0 }, { 17, 0 }, { 0, 0 },
  77. { 0, 16 }, { 17, 16 }, { 34, 16 }, { 52, 16 }, { 69, 16 }, { 86, 16 },
  78. { 86, 32 }, { 69, 32 }, { 52, 32 }, { 34, 32 }, { 17, 32 }, { 0, 32 },
  79. { 0, 48 }, { 17, 48 }, { 34, 48 }, { 52, 48 }, { 69, 48 }, { 86, 48 }, /* No Led */
  80. { 103, 64 }, { 86, 64 }, { 69, 64 }, { 52, 64 }, { 34, 64 },
  81. // Right Underglow (indicies 38 - 45)
  82. { 129, 72 }, { 172, 72 }, { 138, 40 }, { 172, 40 }, { 215, 40 }, { 215, 8 }, { 172, 8 }, { 138, 8 },
  83. // Right Matrix (indicies 46 - 74)
  84. { 138, 0 }, { 155, 0 }, { 172, 0 }, { 190, 0 }, { 207, 0 }, { 224, 0 },
  85. { 224, 16 }, { 207, 16 }, { 190, 16 }, { 172, 16 }, { 155, 16 }, { 138, 16 },
  86. { 138, 32 }, { 155, 32 }, { 172, 32 }, { 190, 32 }, { 207, 32 }, { 224, 32 },
  87. /* No Led */ { 224, 48 }, { 207, 48 }, { 190, 48 }, { 172, 48 }, { 155, 48 }, { 138, 48 },
  88. { 121, 64 }, { 138, 64 }, { 155, 64 }, { 172, 64 }, { 190, 64 }
  89. },
  90. { // LED Index to Flag (2 - Underglow, 4 - Key Backlight)
  91. // Left Underglow
  92. 2, 2, 2, 2, 2, 2, 2, 2,
  93. // Left Matrix
  94. 4, 4, 4, 4, 4, 4,
  95. 4, 4, 4, 4, 4, 4,
  96. 4, 4, 4, 4, 4, 4,
  97. 4, 4, 4, 4, 4, 4,
  98. 4, 4, 4, 4, 4,
  99. // Right Underglow
  100. 2, 2, 2, 2, 2, 2, 2, 2,
  101. // Right Matrix
  102. 4, 4, 4, 4, 4, 4,
  103. 4, 4, 4, 4, 4, 4,
  104. 4, 4, 4, 4, 4, 4,
  105. 4, 4, 4, 4, 4, 4,
  106. 4, 4, 4, 4, 4
  107. }
  108. };
  109. #endif