]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - tmk_core/common/matrix.h
add col type defines
[qmk_firmware.git] / tmk_core / common / matrix.h
index 0b013fc989aedd8a10a2a50c9f2f9c7b7a61a74a..e5665bf40a3f52baabfdd8a36d0ef89baf75fa01 100644 (file)
@@ -14,7 +14,6 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
-
 #ifndef MATRIX_H
 #define MATRIX_H
 
@@ -32,6 +31,16 @@ typedef  uint32_t   matrix_row_t;
 #error "MATRIX_COLS: invalid value"
 #endif
 
+#if (MATRIX_ROWS <= 8)
+typedef  uint8_t    matrix_col_t;
+#elif (MATRIX_ROWS <= 16)
+typedef  uint16_t   matrix_col_t;
+#elif (MATRIX_ROWS <= 32)
+typedef  uint32_t   matrix_col_t;
+#else
+#error "MATRIX_ROWS: invalid value"
+#endif
+
 #define MATRIX_IS_ON(row, col)  (matrix_get_row(row) && (1<<col))
 
 
@@ -51,7 +60,7 @@ void matrix_init(void);
 uint8_t matrix_scan(void);
 /* whether modified from previous scan. used after matrix_scan. */
 bool matrix_is_modified(void) __attribute__ ((deprecated));
-/* whether a swtich is on */
+/* whether a switch is on */
 bool matrix_is_on(uint8_t row, uint8_t col);
 /* matrix state on row */
 matrix_row_t matrix_get_row(uint8_t row);
@@ -63,10 +72,21 @@ void matrix_print(void);
 void matrix_power_up(void);
 void matrix_power_down(void);
 
-/* keyboard-specific setup/loop functionality */
+/* executes code for Quantum */
+void matrix_init_quantum(void);
+void matrix_scan_quantum(void);
+
 void matrix_init_kb(void);
 void matrix_scan_kb(void);
 
+void matrix_init_user(void);
+void matrix_scan_user(void);
+
+#ifdef I2C_SPLIT
+       void slave_matrix_init(void);
+       uint8_t slave_matrix_scan(void);
+#endif
+
 #ifdef __cplusplus
 }
 #endif