canoe_gen2.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. Copyright 2020 Evy Dekkers
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include "canoe_gen2.h"
  15. void keyboard_pre_init_kb(void) {
  16. setPinOutput(E6);
  17. writePinHigh(E6);
  18. }
  19. bool led_update_kb(led_t led_state) {
  20. if(led_update_user(led_state)) {
  21. writePin(E6, !led_state.caps_lock);
  22. }
  23. return true;
  24. }
  25. #ifdef RGB_MATRIX_ENABLE
  26. void suspend_power_down_kb(void) {
  27. rgb_matrix_set_suspend_state(true);
  28. suspend_power_down_user();
  29. }
  30. void suspend_wakeup_init_kb(void) {
  31. rgb_matrix_set_suspend_state(false);
  32. suspend_wakeup_init_user();
  33. }
  34. led_config_t g_led_config = { {
  35. // Key Matrix to LED Index
  36. // 15, 44, 46, 48,
  37. // 74, 75, 76
  38. { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16 },
  39. { 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 13, 31 },
  40. { 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 30, 45, 47 },
  41. { 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63 },
  42. { 64, 65, 66, NO_LED, NO_LED, NO_LED, 67, NO_LED, NO_LED, 69, 70, NO_LED, 71, 72, 73 }
  43. }, {
  44. // LED Index to Physical Position
  45. { 7, 8 }, // Esc
  46. { 22, 8 }, // 1
  47. { 37, 8 }, // 2
  48. { 52, 8 }, // 3
  49. { 67, 8 }, // 4
  50. { 82, 8 }, // 5
  51. { 97, 8 }, // 6
  52. { 112, 8 }, // 7
  53. { 127, 8 }, // 8
  54. { 142, 8 }, // 9
  55. { 157, 8 }, // 0
  56. { 172, 8 }, // -
  57. { 187, 8 }, // =
  58. { 202, 8 }, // split bs
  59. { 209, 8 }, // bs
  60. { 217, 8 }, // split bs
  61. { 231, 8 }, // ins
  62. { 11, 24 }, // tab
  63. { 30, 24 }, // q
  64. { 45, 24 }, // w
  65. { 60, 24 }, // e
  66. { 75, 24 }, // r
  67. { 90, 24 }, // t
  68. { 104, 24 }, // y
  69. { 119, 24 }, // u
  70. { 134, 24 }, // i
  71. { 149, 24 }, // o
  72. { 164, 24 }, // p
  73. { 179, 24 }, // [
  74. { 194, 24 }, // ]
  75. { 212, 24 }, // backslash
  76. { 231, 24 }, // del
  77. { 11, 40 }, // caps
  78. { 34, 40 }, // a
  79. { 49, 40 }, // s
  80. { 64, 40 }, // d
  81. { 79, 40 }, // f
  82. { 94, 40 }, // g
  83. { 108, 40 }, // h
  84. { 123, 40 }, // j
  85. { 138, 40 }, // k
  86. { 153, 40 }, // l
  87. { 168, 40 }, // ;
  88. { 183, 40 }, // '
  89. { 198, 40 }, // iso hash
  90. { 200, 40 }, // ansi enter
  91. { 215, 32 }, // iso enter
  92. { 231, 40 }, // pgup
  93. { 9, 56 }, // iso shift
  94. { 17, 56 }, // ansi shift
  95. { 26, 56 }, // iso nubs
  96. { 41, 56 }, // z
  97. { 56, 56 }, // x
  98. { 71, 56 }, // c
  99. { 86, 56 }, // v
  100. { 101, 56 }, // b
  101. { 116, 56 }, // n
  102. { 131, 56 }, // m
  103. { 146, 56 }, // ,
  104. { 161, 56 }, // .
  105. { 175, 56 }, // ?
  106. { 196, 56 }, // shift
  107. { 217, 56 }, // up
  108. { 231, 56 }, // pgdn
  109. { 10, 72 }, // ctrl
  110. { 29, 72 }, // win
  111. { 48, 72 }, // alt
  112. { 103, 72 }, // space
  113. { 112, 72 }, // space
  114. { 161, 72 }, // alt
  115. { 176, 72 }, // fn
  116. { 202, 72 }, // left
  117. { 217, 72 }, // down
  118. { 231, 72 }, // right
  119. { 7, 40 }, // top 1
  120. { 119, 40 }, // top 2
  121. { 231, 40 } // top 3
  122. }, {
  123. // LED Index to Flag
  124. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
  125. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
  126. 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
  127. 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1, 1, 1,
  128. 1, 1, 1, 4, 4, 1, 1, 1, 1, 1,
  129. 2, 2, 2
  130. } };
  131. #endif