diff options
author | Ryan <[email protected]> | 2024-05-03 15:21:29 +1000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-05-03 15:21:29 +1000 |
commit | d09a06a1b354760fd0e64a453abade972900e885 (patch) | |
tree | 88d94640f4507ac8d7f570607423825bec3c6f89 /keyboards/mexsistor | |
parent | 5426a7a129acf2ff5c8b435014747f1238e17965 (diff) | |
download | qmk_firmware-d09a06a1b354760fd0e64a453abade972900e885.tar.gz qmk_firmware-d09a06a1b354760fd0e64a453abade972900e885.zip |
Update GPIO API usage in keyboard code (#23361)
Diffstat (limited to 'keyboards/mexsistor')
-rw-r--r-- | keyboards/mexsistor/ludmila/matrix.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/keyboards/mexsistor/ludmila/matrix.c b/keyboards/mexsistor/ludmila/matrix.c index 5d27ec683f..fd197f366d 100644 --- a/keyboards/mexsistor/ludmila/matrix.c +++ b/keyboards/mexsistor/ludmila/matrix.c @@ -31,22 +31,22 @@ extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values 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]); } +static void unselect_row(uint8_t 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 init_pins(void) { unselect_rows(); for (uint8_t x = 0; x < MATRIX_COLS; x++) { - setPinInputHigh(col_pins[x]); + gpio_set_pin_input_high(col_pins[x]); } } @@ -64,7 +64,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // For each col... for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { // Select the col pin to read (active low) - uint8_t pin_state = readPin(col_pins[col_index]); + uint8_t pin_state = gpio_read_pin(col_pins[col_index]); // Populate the matrix row with the state of the col pin current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); @@ -79,7 +79,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) void matrix_init_custom(void) { // initialize key pins - setPinInput(ENC_SW); + gpio_set_pin_input(ENC_SW); init_pins(); } @@ -108,7 +108,7 @@ static bool read_encoder_switches(matrix_row_t current_matrix[], uint8_t current static uint8_t btn_1_array; bool btn_1_pressed = 0; btn_1_array <<= 1; - btn_1_array |= readPin(ENC_SW); + btn_1_array |= gpio_read_pin(ENC_SW); (btn_1_array == 0b11111111) ? (btn_1_pressed = 1) : (btn_1_pressed = 0); // Populate the matrix row with the state of the encoder |