]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Scan/CK3/matrix.h
Changed CK3 matrix scan to Config_Pullup, inverted rows and columns
[kiibohd-controller.git] / Scan / CK3 / matrix.h
index 1a2be2e49b7990fc578db2152cc173e564b82573..7f6632d361be95d17bd8af7a6b0ae29f3b9630ff 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2014-2015 by Jacob Alexander
+/* Copyright (C) 2014-2016 by Jacob Alexander, Crystal Hammer
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
 #include <matrix_setup.h>
 
 
-
 // ----- Matrix Definition -----
+//  CK3
+//  Columns (Strobe)  18
+//  Rows    (Sense)   8
 
-// Freescale ARM MK20's support GPIO PTA, PTB, PTC, PTD and PTE 0..31
-// Not all chips have access to all of these pins (most don't have 160 pins :P)
-//
-// NOTE:
-// Before using a pin, make sure it supports being a GPIO *and* doesn't have a default pull-up/pull-down
-// Checking this is completely on the ownness of the user
-
-//
-// Columns (Strobe)  //  PTB0..3,16,17 PTC4,5 PTD0
-// Rows           (Sense)   //  PTD1..7
+//   This is the default map of just A4Tech KX-100 matrix
+//   scan codes for keys are defined in defaultMap.kll
+/*
+      1|   2    3    4    5    6    7    8    9    10  11  12   13   14   15   16   17   18  
+   -
+   1  Mcmp Bstp Esc  \    F4   Up   Del  Ins  Spc  G   H   F6   ==   Vol- AltL xx   F11  '   
+   2  Calc ExA4 ExC2 ExE2 ExE1 <-   Sub  ->   Dn   B   N   ExC1 Apps Mnxt AltR xx   F12  /   
+   3  Mstp Bbck Z    X    C    Mpau Mul  Div  NumL V   M   ,    .    Vol+ xx   CtrR Ent  \   
+   4  GuiR Bfwd A    S    D    Ent  PgDn Dn   End  F   J   K    L    ShiR xx   ==   \    ;   
+   5  xx   Mail Q    W    E    Add  PgUp Up   Home R   U   I    O    xx   ScrL Paus ExE3 P   
+   6  ExB1 GuiL Tab  Caps F3   RB~  ->   Del  <-   T   Y   ]    F7   ShiL ==   Pwr  Back [   
+   7  xx   Bsch 1    2    3    End  PgDn xx   Pwr  4   7   8    9    Msel Ptr  F5   F10  0   
+   8  Bhom Vmut `~   F1   F2   Home PgUp Ins  Del  5   6   =    F8   Mprv ==   CtrL F9   -   
 
-// Define Rows (Sense) and Columns (Strobes)
-GPIO_Pin Matrix_cols[] = { gpio(B,0), gpio(B,1), gpio(B,2), gpio(B,3), gpio(B,16), gpio(B,17), gpio(C,4), gpio(C,6), gpio(D,0) };
-GPIO_Pin Matrix_rows[] = { gpio(D,1), gpio(D,2), gpio(D,3), gpio(D,4), gpio(D,5), gpio(D,6), gpio(D,7) };
+     rows -       columns |
+   1 3 5 7    1 3 5 7 9 11 13 15 17
+    2 4 6 8    2 4 6 8 10 12 14 16 18   connectors, PCB view
+*/
+GPIO_Pin Matrix_cols[] = {
+       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),
+       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)  };
+GPIO_Pin Matrix_rows[] = {
+       gpio(C,10), gpio(C,11), gpio(B,18), gpio(A,4), gpio(A,5), gpio(B,19), gpio(C,9), gpio(C,8) };
 
 // Define type of scan matrix
-Config Matrix_type = Config_Pulldown;
+Config Matrix_type = Config_Pullup;
 
 
 // Define this if your matrix has ghosting (i.e. regular keyboard without diodes)
 // this will enable the anti-ghosting code
 #define GHOSTING_MATRIX
+
+// delay in microseconds before and after each strobe change during matrix scan
+#define STROBE_DELAY  10