Convert Wasdat Code custom matrix to SN74x138 driver (#16257)
This commit is contained in:
parent
e41d67b428
commit
07ca35decf
4 changed files with 77 additions and 310 deletions
|
@ -24,27 +24,28 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
|
||||
/* col 0: C7
|
||||
* col 1: B6
|
||||
* col 2: C6
|
||||
* col 3: B4
|
||||
* col 4: B5
|
||||
* col 5: D7
|
||||
/* Columns 6-12 use a 74HC138 3-to-8 demultiplexer.
|
||||
*
|
||||
* These columns use a 74HC138 3 to 8 bit demultiplexer.
|
||||
* A2 A1 A0
|
||||
* col / pin: PD0 PD1 PD2
|
||||
* 6: 1 1 1
|
||||
* 7: 1 1 0
|
||||
* 8: 1 0 1
|
||||
* 9: 1 0 0
|
||||
* 10: 0 1 1
|
||||
* 11: 0 1 0
|
||||
* 12: 0 0 1
|
||||
* 0: C7
|
||||
* 1: B6
|
||||
* 2: C6
|
||||
* 3: B4
|
||||
* 4: B5
|
||||
* 5: D7
|
||||
*
|
||||
* col 13: D3
|
||||
* col 14: B7
|
||||
* col 15: B3
|
||||
* A2 A1 A0
|
||||
* D0 D1 D2
|
||||
* 6: 1 1 1
|
||||
* 7: 1 1 0
|
||||
* 8: 1 0 1
|
||||
* 9: 1 0 0
|
||||
* 10: 0 1 1
|
||||
* 11: 0 1 0
|
||||
* 12: 0 0 1
|
||||
*
|
||||
* 13: D3
|
||||
* 14: B7
|
||||
* 15: B3
|
||||
*/
|
||||
static void select_col(uint8_t col) {
|
||||
if (col_pins[col] != NO_PIN) {
|
||||
|
@ -117,10 +118,10 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
|||
}
|
||||
|
||||
void matrix_init_custom(void) {
|
||||
// initialize key pins
|
||||
init_pins();
|
||||
// initialize demultiplexer
|
||||
sn74x138_init();
|
||||
// initialize key pins
|
||||
init_pins();
|
||||
}
|
||||
|
||||
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue