#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))
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);
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);