/*
Copyright 2012-2019 Jun Wako, Jack Humbert, Yiancar, Mathias Andersson <wraul@dbox.se>
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/>.
*/
/*
* IC1 (PCA9555) IC2 (PCA9555)
* ,----------. ,----------.
* SDA --| SDA P00 |-- P1 SDA --| SDA P00 |-- P17
* SCL --| SCL P01 |-- P2 SCL --| SCL P01 |-- P18
* INT --| INT P02 |-- P3 INT --| INT P02 |-- P19
* | P03 |-- P4 | P03 |-- P20
* GND --| A0 P04 |-- P5 VCC --| A0 P04 |-- P21
* SJ1 --| A1 P05 |-- P6 SJ1 --| A1 P05 |-- P22
* GND --| A2 P06 |-- P7 GND --| A2 P06 |-- P23
* | P07 |-- P8 | P07 |-- P24
* | | | |
* | P10 |-- P9 | P10 |-- P25
* | P11 |-- P10 | P11 |-- P26
* | P12 |-- P11 | P12 |-- P27
* | P13 |-- P12 | P13 |-- P28
* | P14 |-- P13 | P14 |-- P29
* | P15 |-- P14 | P15 |-- P30
* | P16 |-- P15 | P16 |-- P31
* | P17 |-- P16 | P17 |-- P32
* `----------' `----------'
*/
/*
* | Row | Pin | | Col | Pin |
* | --- | --- | | --- | --- |
* | 0 | P1 | | 0 | P25 |
* | 1 | P2 | | 1 | P26 |
* | 2 | P3 | | 2 | P27 |
* | 3 | P4 | | 3 | P28 |
* | 4 | P5 | | 4 | P29 |
* | 5 | P6 | | 5 | P30 |
* | 6 | P7 | | 6 | P20 |
* | 7 | P8 | | 7 | P21 |
* | 8 | P22 |
* | 9 | P23 |
* | A | P24 |
*/
// PCA9555 slave addresses
// PCA9555 column pin masks
/* matrix state(1:on, 0:off) */
static matrix_row_t raw_matrix; // raw values
static matrix_row_t matrix; // debounced values
void
void
void
void
void
void
inline uint8_t
inline uint8_t
inline bool
inline matrix_row_t
void
uint8_t
static void
static void
static void
static uint16_t
static bool
void
uint8_t