Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

matrix.h 3.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Copyright (C) 2012,2015 by Jacob Alexander
  2. *
  3. * Permission is hereby granted, free of charge, to any person obtaining a copy
  4. * of this software and associated documentation files (the "Software"), to deal
  5. * in the Software without restriction, including without limitation the rights
  6. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. * copies of the Software, and to permit persons to whom the Software is
  8. * furnished to do so, subject to the following conditions:
  9. *
  10. * The above copyright notice and this permission notice shall be included in
  11. * all copies or substantial portions of the Software.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. * THE SOFTWARE.
  20. */
  21. #pragma once
  22. // ----- Includes -----
  23. // Compiler Includes
  24. #include <stdint.h>
  25. // ----- Scan Mode Setting (See matrix_scan.h for more details) -----
  26. #define scanMode scanCol_powrRow
  27. // ----- Key Settings -----
  28. #define KEYBOARD_KEYS 85 // # of keys (It actually has 66, but there are markings up to 80 on the PCB); 85 due to there being 5 "switch" keys, that have no numbers
  29. #define MAX_ROW_SIZE 9 // # of keys in the largest row
  30. #define MAX_COL_SIZE 9 // # of keys in the largest column
  31. // ----- Matrix Configuration -----
  32. static const uint8_t matrix_pinout[][MAX_ROW_SIZE + 1] = {
  33. // SKM Typewriter PCB Matrix
  34. // Note: Pins 50, 51, and 52 are connected together (LShift, RShift, and Lock)
  35. // Board Pins: 13 5 12 6 11 9 8 7 10
  36. { scanMode, pinC0, pinC7, pinC4, pinC2, pinC6, pinC5, pinC3, pinE1, pinC1, },
  37. { pinE6, 71, 72, 73, 74, 75, 76, 80, 55, 53, }, // 1 - White
  38. { pinF7, 43, 81, 45, 41, 54, 44, 46, 58, 42, }, // 2 - Red
  39. { pinF4, 37, 82, 39, 35, 34, 38, 33, 36, 40, }, // 3 - Pink
  40. { pinF5, 31, 83, 25, 28, 27, 32, 26, 30, 29, }, // 4 - Black
  41. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 5 - Blue
  42. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 6 - Red / Blue
  43. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 7 - White / Green
  44. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 8 - Grey / Pink
  45. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 9 - Brown / Green
  46. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 10 - Brown / Grey
  47. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 11 - White / Grey
  48. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 12 - Yellow / White
  49. //{ pinXX, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 13 - Brown / Yellow
  50. { pinF2, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, // 14 - Yellow
  51. { pinF0, 23, 84, 19, 20, 64, 24, 57, 22, 21, }, // 15 - Purple
  52. { pinF1, 17, 85, 12, 14, 13, 11, 18, 16, 15, }, // 16 - Brown
  53. { pinF3, 62, 52, 49, 1, 47, 61, 48, 3, 2, }, // 17 - Green
  54. { pinF6, 4, 63, 6, 8, 7, 5, 56, 9, 10, }, // 18 - Grey
  55. };