mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-09-28 15:50:46 +08:00
Convert Wasdat Code custom matrix to SN74x138 driver (#16257)
This commit is contained in:
@@ -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[]) {
|
||||
|
||||
@@ -41,22 +41,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { E6, C7, C6, B6, B5, B4, D7, D6 }
|
||||
#define MATRIX_COL_PINS { }
|
||||
#define MATRIX_COL_PINS { F7, F5, F6, F1, F4, F0, NO_PIN, D5, D3, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN, NO_PIN } // Columns 6 and 9-15 controlled by demux
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW, ROW2COL*/
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
#define SN74X138_ADDRESS_PINS { D2, D1, D0 }
|
||||
#define SN74X138_E3_PIN D4
|
||||
|
||||
// For QMK DFU
|
||||
#define QMK_ESC_OUTPUT E6
|
||||
#define QMK_ESC_INPUT F0
|
||||
#define QMK_LED B1
|
||||
|
||||
/*
|
||||
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||
*/
|
||||
//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||
|
||||
#define LED_NUM_LOCK_PIN B3
|
||||
#define LED_CAPS_LOCK_PIN B1
|
||||
#define LED_SCROLL_LOCK_PIN B2
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
|
||||
CUSTOM_MATRIX = lite
|
||||
SRC += matrix.c
|
||||
VPATH += drivers/gpio
|
||||
SRC += matrix.c sn74x138.c
|
||||
|
||||
LAYOUTS = fullsize_ansi fullsize_iso tkl_ansi tkl_iso
|
||||
|
||||
Reference in New Issue
Block a user