]> git.friedersdorff.com Git - max/tmk_keyboard.git/blobdiff - tmk_core/common/matrix.h
xt_usb: Fix XT soft reset
[max/tmk_keyboard.git] / tmk_core / common / matrix.h
index 107ee72653894a4b4fbf35b7f0110c8fb91d72f9..bf866477f4579704f82ef337006e7dc581ea12a1 100644 (file)
@@ -32,6 +32,10 @@ typedef  uint32_t   matrix_row_t;
 #error "MATRIX_COLS: invalid value"
 #endif
 
+#if (MATRIX_ROWS > 255)
+#error "MATRIX_ROWS must not exceed 255"
+#endif
+
 #define MATRIX_IS_ON(row, col)  (matrix_get_row(row) && (1<<col))
 
 
@@ -43,7 +47,9 @@ extern "C" {
 uint8_t matrix_rows(void);
 /* number of matrix columns */
 uint8_t matrix_cols(void);
-/* intialize matrix for scaning. should be called once. */
+/* should be called at early stage of startup before matrix_init.(optional) */
+void matrix_setup(void);
+/* intialize matrix for scaning. */
 void matrix_init(void);
 /* scan all key states on matrix */
 uint8_t matrix_scan(void);
@@ -55,7 +61,12 @@ bool matrix_is_on(uint8_t row, uint8_t col);
 matrix_row_t matrix_get_row(uint8_t row);
 /* print matrix for debug */
 void matrix_print(void);
+/* clear matrix */
+void matrix_clear(void);
 
+#ifdef MATRIX_HAS_GHOST
+bool matrix_has_ghost_in_row(uint8_t row);
+#endif
 
 /* power control */
 void matrix_power_up(void);