Update GPIO API usage in keyboard code (#23361)
This commit is contained in:
parent
5426a7a129
commit
d09a06a1b3
390 changed files with 3912 additions and 3913 deletions
|
@ -22,22 +22,22 @@ static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
|||
static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
|
||||
static void select_col(uint8_t col) {
|
||||
setPinOutput(col_pins[col]);
|
||||
writePinHigh(col_pins[col]);
|
||||
gpio_set_pin_output(col_pins[col]);
|
||||
gpio_write_pin_high(col_pins[col]);
|
||||
}
|
||||
|
||||
static void unselect_col(uint8_t col) { setPinInputLow(col_pins[col]); }
|
||||
static void unselect_col(uint8_t col) { gpio_set_pin_input_low(col_pins[col]); }
|
||||
|
||||
static void unselect_cols(void) {
|
||||
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
setPinInputLow(col_pins[x]);
|
||||
gpio_set_pin_input_low(col_pins[x]);
|
||||
}
|
||||
}
|
||||
|
||||
static void init_pins(void) {
|
||||
unselect_cols();
|
||||
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||
setPinInputLow(row_pins[x]);
|
||||
gpio_set_pin_input_low(row_pins[x]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
|||
matrix_row_t current_row_value = last_row_value;
|
||||
|
||||
// Check row pin state
|
||||
if (readPin(row_pins[row_index]) != 0) {
|
||||
if (gpio_read_pin(row_pins[row_index]) != 0) {
|
||||
// Pin LO, set col bit
|
||||
current_row_value |= (MATRIX_ROW_SHIFTER << current_col);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue