/*
Note to self: adapted from ergodox EZ matrix
The "column" and "row" in here actually refers to the opposite on the keyboard
see definition of KEYMAP in v1.h, the grid is transposed so that a "row" in here is actually a "column" on the physical keyboard
Nicolas
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
Copyright 2013 Nicolas Poirey <nicolas.poirey@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
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/>.
*/
/*
* scan matrix
*/
/*
* This constant define not debouncing time in msecs, but amount of matrix
* scan loops which should be made to get stable debounced results.
*
* On Ergodox matrix scan rate is relatively low, because of slow I2C.
* Now it's only 317 scans/second, or about 3.15 msec/scan.
* According to Cherry specs, debouncing time is 5 msec.
*
* And so, there is no sense to have DEBOUNCE higher than 2.
*/
static uint8_t debouncing = DEBOUNCE;
/* matrix state(1:on, 0:off) */
static matrix_row_t matrix;
static matrix_row_t matrix_debouncing;
static matrix_row_t ;
static void ;
static void ;
static void ;
static uint8_t mcp23018_reset_loop;
void
void
void
void
inline
uint8_t
inline
uint8_t
void
void
uint8_t
bool
inline
bool
inline
matrix_row_t
void
uint8_t
/* Column pin configuration
*
* Teensy
* col: 0 1 2 3 4 5
* pin: F0 F1 F4 F5 F6 F7
*
* MCP23018
* col: 0 1 2 3 4 5
* pin: B5 B4 B3 B2 B1 B0
*/
static void
static matrix_row_t
/* Row pin configuration
*
* Teensy
* row: 7 8 9 10 11 12 13
* pin: B0 B1 B2 B3 D2 D3 C6
*
* MCP23018
* row: 0 1 2 3 4 5 6
* pin: A0 A1 A2 A3 A4 A5 A6
*/
static void
static void