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
|
@ -48,7 +48,7 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
|||
*/
|
||||
static void select_col(uint8_t col) {
|
||||
if (col_pins[col] != NO_PIN) {
|
||||
writePinLow(col_pins[col]);
|
||||
gpio_write_pin_low(col_pins[col]);
|
||||
} else {
|
||||
sn74x138_set_addr((col == 6) ? 7 : 15 - col);
|
||||
sn74x138_set_enabled(true);
|
||||
|
@ -57,8 +57,8 @@ static void select_col(uint8_t col) {
|
|||
|
||||
static void unselect_col(uint8_t col) {
|
||||
if (col_pins[col] != NO_PIN) {
|
||||
setPinOutput(col_pins[col]);
|
||||
writePinHigh(col_pins[col]);
|
||||
gpio_set_pin_output(col_pins[col]);
|
||||
gpio_write_pin_high(col_pins[col]);
|
||||
} else {
|
||||
sn74x138_set_enabled(false);
|
||||
}
|
||||
|
@ -68,8 +68,8 @@ static void unselect_cols(void) {
|
|||
// Native
|
||||
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||
if (col_pins[x] != NO_PIN) {
|
||||
setPinOutput(col_pins[x]);
|
||||
writePinHigh(col_pins[x]);
|
||||
gpio_set_pin_output(col_pins[x]);
|
||||
gpio_write_pin_high(col_pins[x]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ static void unselect_cols(void) {
|
|||
static void init_pins(void) {
|
||||
unselect_cols();
|
||||
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||
setPinInputHigh(row_pins[x]);
|
||||
gpio_set_pin_input_high(row_pins[x]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
|||
matrix_row_t last_row_value = current_matrix[row_index];
|
||||
|
||||
// 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_matrix[row_index] |= (MATRIX_ROW_SHIFTER << current_col);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue