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/3w6 | |
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/3w6')
-rw-r--r-- | keyboards/3w6/rev1/matrix.c | 14 | ||||
-rw-r--r-- | keyboards/3w6/rev2/matrix.c | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/keyboards/3w6/rev1/matrix.c b/keyboards/3w6/rev1/matrix.c index aa3e43fbe0..0c06a743a1 100644 --- a/keyboards/3w6/rev1/matrix.c +++ b/keyboards/3w6/rev1/matrix.c @@ -165,8 +165,8 @@ static void init_cols(void) { pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L; for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { pin_t pin = matrix_col_pins_mcu[pin_index]; - setPinInput(pin); - writePinHigh(pin); + gpio_set_pin_input(pin); + gpio_write_pin_high(pin); } } @@ -177,7 +177,7 @@ static matrix_row_t read_cols(uint8_t row) { // For each col... for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { // Select the col pin to read (active low) - uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); + uint8_t pin_state = gpio_read_pin(matrix_col_pins_mcu[col_index]); // Populate the matrix row with the state of the col pin current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); @@ -223,8 +223,8 @@ static void unselect_rows(void) { pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { pin_t pin = matrix_row_pins_mcu[pin_index]; - setPinInput(pin); - writePinLow(pin); + gpio_set_pin_input(pin); + gpio_write_pin_low(pin); } } @@ -236,8 +236,8 @@ static void select_row(uint8_t row) { // select on atmega32u4 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; pin_t pin = matrix_row_pins_mcu[row]; - setPinOutput(pin); - writePinLow(pin); + gpio_set_pin_output(pin); + gpio_write_pin_low(pin); } else { // select on tca9555 if (tca9555_status) { // if there was an error diff --git a/keyboards/3w6/rev2/matrix.c b/keyboards/3w6/rev2/matrix.c index da7a5344e5..8c628215aa 100644 --- a/keyboards/3w6/rev2/matrix.c +++ b/keyboards/3w6/rev2/matrix.c @@ -165,8 +165,8 @@ static void init_cols(void) { pin_t matrix_col_pins_mcu[MATRIX_COLS_PER_SIDE] = MATRIX_COL_PINS_L; for (int pin_index = 0; pin_index < MATRIX_COLS_PER_SIDE; pin_index++) { pin_t pin = matrix_col_pins_mcu[pin_index]; - setPinInput(pin); - writePinHigh(pin); + gpio_set_pin_input(pin); + gpio_write_pin_high(pin); } } @@ -177,7 +177,7 @@ static matrix_row_t read_cols(uint8_t row) { // For each col... for (uint8_t col_index = 0; col_index < MATRIX_COLS_PER_SIDE; col_index++) { // Select the col pin to read (active low) - uint8_t pin_state = readPin(matrix_col_pins_mcu[col_index]); + uint8_t pin_state = gpio_read_pin(matrix_col_pins_mcu[col_index]); // Populate the matrix row with the state of the col pin current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); @@ -221,8 +221,8 @@ static void unselect_rows(void) { pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; for (int pin_index = 0; pin_index < MATRIX_ROWS_PER_SIDE; pin_index++) { pin_t pin = matrix_row_pins_mcu[pin_index]; - setPinInput(pin); - writePinLow(pin); + gpio_set_pin_input(pin); + gpio_write_pin_low(pin); } } @@ -233,8 +233,8 @@ static void select_row(uint8_t row) { // select on atmega32u4 pin_t matrix_row_pins_mcu[MATRIX_ROWS_PER_SIDE] = MATRIX_ROW_PINS_L; pin_t pin = matrix_row_pins_mcu[row]; - setPinOutput(pin); - writePinLow(pin); + gpio_set_pin_output(pin); + gpio_write_pin_low(pin); } else { // select on tca9555 if (tca9555_status) { // if there was an error |