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) 2014-2016 by Jacob Alexander, Crystal Hammer
  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. // Project Includes
  24. #include <matrix_setup.h>
  25. // ----- Matrix Definition -----
  26. // CK3
  27. // Columns (Strobe) 18
  28. // Rows (Sense) 8
  29. // This is the default map of just A4Tech KX-100 matrix
  30. // scan codes for keys are defined in defaultMap.kll
  31. /*
  32. 1| 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
  33. -
  34. 1 Mcmp Bstp Esc \ F4 Up Del Ins Spc G H F6 == Vol- AltL xx F11 '
  35. 2 Calc ExA4 ExC2 ExE2 ExE1 <- Sub -> Dn B N ExC1 Apps Mnxt AltR xx F12 /
  36. 3 Mstp Bbck Z X C Mpau Mul Div NumL V M , . Vol+ xx CtrR Ent \
  37. 4 GuiR Bfwd A S D Ent PgDn Dn End F J K L ShiR xx == \ ;
  38. 5 xx Mail Q W E Add PgUp Up Home R U I O xx ScrL Paus ExE3 P
  39. 6 ExB1 GuiL Tab Caps F3 RB~ -> Del <- T Y ] F7 ShiL == Pwr Back [
  40. 7 xx Bsch 1 2 3 End PgDn xx Pwr 4 7 8 9 Msel Ptr F5 F10 0
  41. 8 Bhom Vmut `~ F1 F2 Home PgUp Ins Del 5 6 = F8 Mprv == CtrL F9 -
  42. rows - columns |
  43. 1 3 5 7 1 3 5 7 9 11 13 15 17
  44. 2 4 6 8 2 4 6 8 10 12 14 16 18 connectors, PCB view
  45. */
  46. GPIO_Pin Matrix_cols[] = {
  47. gpio(B,16), gpio(B,17), gpio(D,0), gpio(A,12), gpio(A,13), gpio(D,7), gpio(D,4), gpio(D,2), gpio(D,3),
  48. gpio(C,2), gpio(C,1), gpio(D,6), gpio(D,5), gpio(B,2), gpio(B,3), gpio(B,1), gpio(B,0), gpio(C,0) };
  49. GPIO_Pin Matrix_rows[] = {
  50. gpio(C,10), gpio(C,11), gpio(B,18), gpio(A,4), gpio(A,5), gpio(B,19), gpio(C,9), gpio(C,8) };
  51. // Define type of scan matrix
  52. Config Matrix_type = Config_Pullup;
  53. // Define this if your matrix has ghosting (i.e. regular keyboard without diodes)
  54. // this will enable the anti-ghosting code
  55. #define GHOSTING_MATRIX
  56. // delay in microseconds before and after each strobe change during matrix scan
  57. #define STROBE_DELAY 10