cospad.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* Copyright 2019
  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. #pragma once
  17. #include "quantum.h"
  18. #define ___ KC_NO
  19. /* This a shortcut to help you visually see your layout.
  20. *
  21. * The first section contains all of the arguments representing the physical
  22. * layout of the board and position of the keys.
  23. *
  24. * The second converts the arguments into a two-dimensional array which
  25. * represents the switch matrix.
  26. */
  27. /* COSPAD ortho matrix layout
  28. * ,-------------------.
  29. * | 00 | 01 | 02 | 03 |
  30. * |----|----|----|----|
  31. * | 10 | 11 | 12 | 13 |
  32. * |----|----|----|----|
  33. * | 20 | 21 | 22 | 23 |
  34. * |----|----|----|----|
  35. * | 30 | 31 | 32 | 33 |
  36. * |----|----|----|----|
  37. * | 40 | 41 | 42 | 43 |
  38. * |----|----|----|----|
  39. * | 50 | 51 | 52 | 53 |
  40. * `-------------------'
  41. */
  42. #define LAYOUT_ortho_6x4( \
  43. k00, k01, k02, k03, \
  44. k10, k11, k12, k13, \
  45. k20, k21, k22, k23, \
  46. k30, k31, k32, k33, \
  47. k40, k41, k42, k43, \
  48. k50, k51, k52, k53 \
  49. ) \
  50. { \
  51. {k00, k01, k02, k03}, \
  52. {k10, k11, k12, k13}, \
  53. {k20, k21, k22, k23}, \
  54. {k30, k31, k32, k33}, \
  55. {k40, k41, k42, k43}, \
  56. {k50, k51, k52, k53} \
  57. }
  58. /* COSPAD gamepad matrix layout
  59. * ,-------------------.
  60. * | 00 | 01 | 02 | 03 |
  61. * |----|----|----|----|
  62. * | 10 | 11 | 12 | 13 |
  63. * |----|----|----|----|
  64. * | 20 | 21 | 22 | |
  65. * |----|----|----| 23 |
  66. * | 30 | 31 | 32 | |
  67. * |----|----|----|----|
  68. * | 40 | 41 | 42 | 43 |
  69. * |----|----|----|----|
  70. * | 50 | 51 | 52 | 53 |
  71. * `-------------------'
  72. */
  73. #define LAYOUT_gamepad_6x4( \
  74. k00, k01, k02, k03, \
  75. k10, k11, k12, k13, \
  76. k20, k21, k22, \
  77. k30, k31, k32, k23, \
  78. k40, k41, k42, k43, \
  79. k50, k51, k52, k53 \
  80. ) \
  81. { \
  82. {k00, k01, k02, k03}, \
  83. {k10, k11, k12, k13}, \
  84. {k20, k21, k22, k23}, \
  85. {k30, k31, k32, ___}, \
  86. {k40, k41, k42, k43}, \
  87. {k50, k51, k52, k53} \
  88. }
  89. /* COSPAD numpad matrix layout
  90. * ,-------------------.
  91. * | 00 | 01 | 02 | 03 |
  92. * |----|----|----|----|
  93. * | 10 | 11 | 12 | 13 |
  94. * |----|----|----|----|
  95. * | 20 | 21 | 22 | |
  96. * |----|----|----| 23 |
  97. * | 30 | 31 | 32 | |
  98. * |----|----|----|----|
  99. * | 40 | 41 | 42 | |
  100. * |----|----|----| 43 |
  101. * | 50 | 52 | |
  102. * `-------------------'
  103. */
  104. #define LAYOUT_numpad_6x4( \
  105. k00, k01, k02, k03, \
  106. k10, k11, k12, k13, \
  107. k20, k21, k22, \
  108. k30, k31, k32, k23, \
  109. k40, k41, k42, \
  110. k50, k52, k43 \
  111. ) \
  112. { \
  113. {k00, k01, k02, k03}, \
  114. {k10, k11, k12, k13}, \
  115. {k20, k21, k22, k23}, \
  116. {k30, k31, k32, ___}, \
  117. {k40, k41, k42, k43}, \
  118. {k50, ___, k52, ___} \
  119. }
  120. // Add backwards compatibility for existing keymaps
  121. #define cospad_bl_led_on backlight_enable
  122. #define cospad_bl_led_off backlight_disable
  123. #define cospad_bl_led_togg backlight_toggle