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.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 90 // # of keys (It actually has 78, but there are markings up to 81 on the PCB and scan lines enough for 90
  29. #define MAX_ROW_SIZE 6 // # of rows
  30. #define MAX_COL_SIZE 15 // # of columns
  31. // ----- Matrix Configuration -----
  32. static const uint8_t matrix_pinout[][MAX_COL_SIZE + 1] = {
  33. // GND Pins
  34. // Board Pins: 2, 8, 14, 20, 24
  35. // OO2 Labels: 3, 7, 13, 19, 25
  36. // IBM Convertible PCB Matrix
  37. // Board Pins labeled as ()
  38. // Board Pins: 26 25 23 22 21 19 17 15 13 11 9 7 5 3 1
  39. // OO2 Labels: 1 2 4 5 6 8 10 12 14 16 18 20 22 24 26
  40. // C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 C13 C14 C15
  41. { scanMode, pinC0, pinC1, pinC2, pinC3, pinC4, pinC5, pinC6, pinC7, pinF0, pinF1, pinF2, pinF3, pinF4, pinF5, pinF6 },
  42. { pinE1, 80, 79, 78, 81, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, }, // R1 - 9 (18)
  43. { pinE2, 14, 13, 12, 15, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, }, // R2 - 11 (16)
  44. { pinE3, 0, 28, 27, 0, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, }, // R3 - 15 (12)
  45. { pinE4, 43, 0, 41, 0, 40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, }, // R4 - 17 (10)
  46. { pinE5, 57, 0, 56, 0, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 44, }, // R5 - 21 (6)
  47. { pinE6, 65, 0, 64, 66, 63, 62, 0, 0, 0, 61, 0, 0, 60, 59, 58, }, // R6 - 23 (4)
  48. };