2 Copyright 2011 Jun Wako <wakojun@gmail.com>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 typedef uint8_t matrix_row_t;
25 #elif MATRIX_COLS <= 16
26 typedef uint16_t matrix_row_t;
27 #elif MATRIX_COLS <= 32
28 typedef uint32_t matrix_row_t;
30 # error "There are too many columns."
33 #if DIODE_DIRECTION == ROW2COL
35 typedef uint8_t matrix_col_t;
36 # elif MATRIX_ROWS <= 16
37 typedef uint16_t matrix_col_t;
38 # elif MATRIX_ROWS <= 32
39 typedef uint32_t matrix_col_t;
41 # error "There are too many rows."
53 /* counts the number of rows in the matrix */
54 uint8_t matrix_rows(void);
55 /* counts the number of columns in the matrix */
56 uint8_t matrix_cols(void);
57 /* sets up the matrix before matrix_init */
58 void matrix_setup(void);
59 /* intializes the matrix */
60 void matrix_init(void);
61 /* scans the entire matrix */
62 uint8_t matrix_scan(void);
63 /* checks if the matrix has been modified */
64 bool matrix_is_modified(void) __attribute__ ((deprecated));
65 /* checks if a key is pressed */
66 bool matrix_is_on(uint8_t row, uint8_t col);
67 /* inspects the state of a row in the matrix */
68 matrix_row_t matrix_get_row(uint8_t row);
69 /* prints the matrix for debugging */
70 void matrix_print(void);
71 /* counts the total number of keys pressed */
72 uint8_t matrix_key_count(void);
73 /* controls power to the matrix */
74 void matrix_power_up(void);
75 void matrix_power_down(void);
76 /* executes code for Quantum */
77 void matrix_init_quantum(void);
78 void matrix_scan_quantum(void);
80 void matrix_init_kb(void);
81 void matrix_scan_kb(void);
83 void matrix_init_user(void);
84 void matrix_scan_user(void);