Update GPIO macros in keymaps (#23792)
This commit is contained in:
parent
8ff8e9eae5
commit
b8f29c3865
82 changed files with 402 additions and 402 deletions
|
@ -30,32 +30,32 @@ static const pin_t row_pins[] = MATRIX_ROW_PINS;
|
|||
static const pin_t col_pins[] = MATRIX_COL_PINS;
|
||||
|
||||
static void select_row(uint8_t row) {
|
||||
setPinOutput(row_pins[row]);
|
||||
writePinLow(row_pins[row]);
|
||||
gpio_set_pin_output(row_pins[row]);
|
||||
gpio_write_pin_low(row_pins[row]);
|
||||
}
|
||||
|
||||
static void unselect_row(uint8_t row) {
|
||||
setPinInputHigh(row_pins[row]);
|
||||
gpio_set_pin_input_high(row_pins[row]);
|
||||
}
|
||||
|
||||
static void unselect_rows(void) {
|
||||
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||
setPinInputHigh(row_pins[x]);
|
||||
gpio_set_pin_input_high(row_pins[x]);
|
||||
}
|
||||
}
|
||||
|
||||
static void select_col(uint8_t col) {
|
||||
setPinOutput(col_pins[col]);
|
||||
writePinLow(col_pins[col]);
|
||||
gpio_set_pin_output(col_pins[col]);
|
||||
gpio_write_pin_low(col_pins[col]);
|
||||
}
|
||||
|
||||
static void unselect_col(uint8_t col) {
|
||||
setPinInputHigh(col_pins[col]);
|
||||
gpio_set_pin_input_high(col_pins[col]);
|
||||
}
|
||||
|
||||
static void unselect_cols(void) {
|
||||
for (uint8_t x = 0; x < MATRIX_COLS/2; x++) {
|
||||
setPinInputHigh(col_pins[x*2]);
|
||||
gpio_set_pin_input_high(col_pins[x*2]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,7 +76,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
|||
for (uint8_t col_index = 0; col_index < MATRIX_COLS / 2; col_index++) {
|
||||
uint16_t column_index_bitmask = ROW_SHIFTER << ((col_index * 2) + 1);
|
||||
// Check row pin state
|
||||
if (readPin(col_pins[col_index*2])) {
|
||||
if (gpio_read_pin(col_pins[col_index*2])) {
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[current_row] &= ~column_index_bitmask;
|
||||
} else {
|
||||
|
@ -105,7 +105,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
|||
|
||||
uint16_t column_index_bitmask = ROW_SHIFTER << (current_col * 2);
|
||||
// Check row pin state
|
||||
if (readPin(row_pins[row_index])) {
|
||||
if (gpio_read_pin(row_pins[row_index])) {
|
||||
// Pin HI, clear col bit
|
||||
current_matrix[row_index] &= ~column_index_bitmask;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue