diff --git a/keyboards/3w6/rev1/matrix.c b/keyboards/3w6/rev1/matrix.c index aa3e43fbe05..49b94b0d69a 100644 --- a/keyboards/3w6/rev1/matrix.c +++ b/keyboards/3w6/rev1/matrix.c @@ -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); diff --git a/keyboards/3w6/rev2/matrix.c b/keyboards/3w6/rev2/matrix.c index da7a5344e5f..04e7a3e9508 100644 --- a/keyboards/3w6/rev2/matrix.c +++ b/keyboards/3w6/rev2/matrix.c @@ -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); diff --git a/keyboards/al1/matrix.c b/keyboards/al1/matrix.c index e3d7971f1c2..d161ae38be0 100644 --- a/keyboards/al1/matrix.c +++ b/keyboards/al1/matrix.c @@ -65,7 +65,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 { diff --git a/keyboards/argyle/matrix.c b/keyboards/argyle/matrix.c index d723392a013..2ca58004212 100644 --- a/keyboards/argyle/matrix.c +++ b/keyboards/argyle/matrix.c @@ -46,7 +46,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return (readPin(pin) == 0) ? 0 : 1; + return (gpio_read_pin(pin) == 0) ? 0 : 1; } else { return 1; } diff --git a/keyboards/bandominedoni/bandominedoni.c b/keyboards/bandominedoni/bandominedoni.c index 2884e41c9c1..75fdec04cbc 100644 --- a/keyboards/bandominedoni/bandominedoni.c +++ b/keyboards/bandominedoni/bandominedoni.c @@ -75,7 +75,7 @@ static uint8_t peek_matrix_intersection(pin_t out_pin, pin_t in_pin) { writePinLow(out_pin); // It's almost unnecessary, but wait until it's down to low, just in case. wait_us(1); - uint8_t pin_state = readPin(in_pin); + uint8_t pin_state = gpio_read_pin(in_pin); // Set out_pin to a setting that is less susceptible to noise. setPinInputHigh(out_pin); matrix_io_delay(); // Wait for the pull-up to go HIGH. @@ -94,7 +94,7 @@ static enum { UNKNOWN, LEFT, RIGHT } hand_side = UNKNOWN; #if defined(SPLIT_HAND_PIN) // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand setPinInput(SPLIT_HAND_PIN); - hand_side = readPin(SPLIT_HAND_PIN) ? LEFT : RIGHT; + hand_side = gpio_read_pin(SPLIT_HAND_PIN) ? LEFT : RIGHT; return (hand_side == LEFT); #elif defined(SPLIT_HAND_MATRIX_GRID) # ifdef SPLIT_HAND_MATRIX_GRID_LOW_IS_LEFT diff --git a/keyboards/barleycorn_smd/matrix.c b/keyboards/barleycorn_smd/matrix.c index 315093c8a98..fc375588619 100644 --- a/keyboards/barleycorn_smd/matrix.c +++ b/keyboards/barleycorn_smd/matrix.c @@ -113,7 +113,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) pin_state = port_expander_col_buffer[1] & (1 << 1); break; default : - pin_state = readPin(col_pins[col_index]); + pin_state = gpio_read_pin(col_pins[col_index]); } // Populate the matrix row with the state of the col pin diff --git a/keyboards/bastardkb/charybdis/charybdis.c b/keyboards/bastardkb/charybdis/charybdis.c index c9f0e631728..f4db2567ad6 100644 --- a/keyboards/bastardkb/charybdis/charybdis.c +++ b/keyboards/bastardkb/charybdis/charybdis.c @@ -376,7 +376,7 @@ void keyboard_pre_init_kb(void) { } void matrix_scan_kb(void) { - if (!readPin(A0)) { + if (!gpio_read_pin(A0)) { reset_keyboard(); } matrix_scan_user(); diff --git a/keyboards/clueboard/2x1800/2019/2019.c b/keyboards/clueboard/2x1800/2019/2019.c index 40032cd6697..6e19f4f2a80 100644 --- a/keyboards/clueboard/2x1800/2019/2019.c +++ b/keyboards/clueboard/2x1800/2019/2019.c @@ -65,7 +65,7 @@ void matrix_scan_kb(void) { #ifdef SHAKE_ENABLE // Read the current state of the tilt sensor. It is physically // impossible for both pins to register a low state at the same time. - uint8_t tilt_read = (readPin(SHAKE_PIN_A) << 4) | readPin(SHAKE_PIN_B); + uint8_t tilt_read = (gpio_read_pin(SHAKE_PIN_A) << 4) | gpio_read_pin(SHAKE_PIN_B); // Check to see if the tilt sensor has changed state since our last read if (tilt_state != tilt_read) { diff --git a/keyboards/converter/palm_usb/matrix.c b/keyboards/converter/palm_usb/matrix.c index 8ae89deb6ae..75ee94f44c2 100644 --- a/keyboards/converter/palm_usb/matrix.c +++ b/keyboards/converter/palm_usb/matrix.c @@ -113,9 +113,9 @@ void pins_init(void) { #endif /* check that the other side isn't powered up. - test=readPin(DCD_PIN); + test=gpio_read_pin(DCD_PIN); xprintf("b%02X:", test); - test=readPin(RTS_PIN); + test=gpio_read_pin(RTS_PIN); xprintf("%02X\n", test); */ @@ -128,7 +128,7 @@ uint8_t rts_reset(void) { // On boot, we keep rts as input, then switch roles here // on leaving sleep, we toggle the same way - firstread=readPin(RTS_PIN); + firstread=gpio_read_pin(RTS_PIN); // printf("r%02X:", firstread); setPinOutput(RTS_PIN); @@ -264,7 +264,7 @@ void matrix_init(void) } #else /// Palm / HP device with DCD - while( !readPin(DCD_PIN) ) {;} + while( !gpio_read_pin(DCD_PIN) ) {;} print("dcd\n"); rts_reset(); // at this point the keyboard should think all is well. diff --git a/keyboards/converter/siemens_tastatur/matrix.c b/keyboards/converter/siemens_tastatur/matrix.c index ea1aa2287e0..c07162f44eb 100644 --- a/keyboards/converter/siemens_tastatur/matrix.c +++ b/keyboards/converter/siemens_tastatur/matrix.c @@ -210,7 +210,7 @@ uint8_t matrix_scan(void) { matrix[3] = 0x00; } //Special case for Shift - if (readPin(B11) == 0) { matrix[3] |= 0x01; } + if (gpio_read_pin(B11) == 0) { matrix[3] |= 0x01; } porta_buffer = 65535; portb_buffer = 65535; diff --git a/keyboards/converter/xt_usb/xt.h b/keyboards/converter/xt_usb/xt.h index 538ff0e459f..71835bc441f 100644 --- a/keyboards/converter/xt_usb/xt.h +++ b/keyboards/converter/xt_usb/xt.h @@ -46,7 +46,7 @@ POSSIBILITY OF SUCH DAMAGE. writePinHigh(XT_DATA_PIN); \ } while (0) -#define XT_DATA_READ() readPin(XT_DATA_PIN) +#define XT_DATA_READ() gpio_read_pin(XT_DATA_PIN) #define XT_DATA_LO() \ do { \ @@ -60,7 +60,7 @@ POSSIBILITY OF SUCH DAMAGE. writePinHigh(XT_CLOCK_PIN); \ } while (0) -#define XT_CLOCK_READ() readPin(XT_CLOCK_PIN) +#define XT_CLOCK_READ() gpio_read_pin(XT_CLOCK_PIN) #define XT_CLOCK_LO() \ do { \ diff --git a/keyboards/custommk/evo70_r2/matrix.c b/keyboards/custommk/evo70_r2/matrix.c index 99a23a4542e..fdfc1bd4c9d 100644 --- a/keyboards/custommk/evo70_r2/matrix.c +++ b/keyboards/custommk/evo70_r2/matrix.c @@ -9,7 +9,7 @@ void matrix_wait_for_pin(pin_t pin, uint8_t target_state) { rtcnt_t start = chSysGetRealtimeCounterX(); rtcnt_t end = start + 5000; while (chSysIsCounterWithinX(chSysGetRealtimeCounterX(), start, end)) { - if (readPin(pin) == target_state) { + if (gpio_read_pin(pin) == target_state) { break; } } diff --git a/keyboards/doppelganger/doppelganger.c b/keyboards/doppelganger/doppelganger.c index 9a9fc0679f2..7aa2e533609 100644 --- a/keyboards/doppelganger/doppelganger.c +++ b/keyboards/doppelganger/doppelganger.c @@ -41,5 +41,5 @@ __attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) { // Override core logic as we reuse SPLIT_HAND_PIN within matrix pins bool is_keyboard_left(void) { setPinInput(SPLIT_HAND_PIN); - return readPin(SPLIT_HAND_PIN); + return gpio_read_pin(SPLIT_HAND_PIN); } diff --git a/keyboards/dp60/matrix.c b/keyboards/dp60/matrix.c index e32c9a58f94..253bea4dfce 100644 --- a/keyboards/dp60/matrix.c +++ b/keyboards/dp60/matrix.c @@ -129,11 +129,11 @@ static void init_rows(void) static uint8_t read_rows(void) { - return ((readPin(E6) ? 0 : (1 << 0)) | - (readPin(F6) ? 0 : (1 << 1)) | - (readPin(F7) ? 0 : (1 << 2)) | - (readPin(B7) ? 0 : (1 << 3)) | - (readPin(D4) ? 0 : (1 << 4))); + return ((gpio_read_pin(E6) ? 0 : (1 << 0)) | + (gpio_read_pin(F6) ? 0 : (1 << 1)) | + (gpio_read_pin(F7) ? 0 : (1 << 2)) | + (gpio_read_pin(B7) ? 0 : (1 << 3)) | + (gpio_read_pin(D4) ? 0 : (1 << 4))); } /* diff --git a/keyboards/durgod/k310/k310.c b/keyboards/durgod/k310/k310.c index 8b0e3408ec6..2c59666982c 100644 --- a/keyboards/durgod/k310/k310.c +++ b/keyboards/durgod/k310/k310.c @@ -83,7 +83,7 @@ void keyboard_pre_init_kb(void) { palSetPadCallback(PAL_PORT(HARDWARE_RESET_PIN), PAL_PAD(HARDWARE_RESET_PIN), hardware_reset_cb, NULL); /* The interrupt is edge-triggered so check that it's not already pressed */ - if (!readPin(HARDWARE_RESET_PIN)) { + if (!gpio_read_pin(HARDWARE_RESET_PIN)) { bootloader_jump(); } #endif diff --git a/keyboards/durgod/k320/k320.c b/keyboards/durgod/k320/k320.c index 82f2d75ff3f..148419ee3e4 100644 --- a/keyboards/durgod/k320/k320.c +++ b/keyboards/durgod/k320/k320.c @@ -83,7 +83,7 @@ void keyboard_pre_init_kb(void) { palSetPadCallback(PAL_PORT(HARDWARE_RESET_PIN), PAL_PAD(HARDWARE_RESET_PIN), hardware_reset_cb, NULL); /* The interrupt is edge-triggered so check that it's not already pressed */ - if (!readPin(HARDWARE_RESET_PIN)) { + if (!gpio_read_pin(HARDWARE_RESET_PIN)) { bootloader_jump(); } #endif diff --git a/keyboards/evyd13/wasdat/matrix.c b/keyboards/evyd13/wasdat/matrix.c index 60a1ea235a8..70e363fb49a 100644 --- a/keyboards/evyd13/wasdat/matrix.c +++ b/keyboards/evyd13/wasdat/matrix.c @@ -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 { diff --git a/keyboards/evyd13/wasdat_code/matrix.c b/keyboards/evyd13/wasdat_code/matrix.c index f30ea3355a1..b039d2e6a6e 100644 --- a/keyboards/evyd13/wasdat_code/matrix.c +++ b/keyboards/evyd13/wasdat_code/matrix.c @@ -100,7 +100,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 { diff --git a/keyboards/ferris/0_1/matrix.c b/keyboards/ferris/0_1/matrix.c index 154a275d7a0..6baa46ee509 100644 --- a/keyboards/ferris/0_1/matrix.c +++ b/keyboards/ferris/0_1/matrix.c @@ -194,7 +194,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); diff --git a/keyboards/ferris/0_2/matrix.c b/keyboards/ferris/0_2/matrix.c index cf26385f4c8..1552d555cb1 100644 --- a/keyboards/ferris/0_2/matrix.c +++ b/keyboards/ferris/0_2/matrix.c @@ -173,7 +173,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); diff --git a/keyboards/geistmaschine/macropod/matrix.c b/keyboards/geistmaschine/macropod/matrix.c index 60b1dafe637..409d1234e93 100644 --- a/keyboards/geistmaschine/macropod/matrix.c +++ b/keyboards/geistmaschine/macropod/matrix.c @@ -78,7 +78,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { } // Shift pin states by 1 to make room for the switch connected to the MCU, then OR them together and invert (as QMK uses inverted logic compared to the electrical levels) - matrix_row_t data = ~(pin_states << 1 | readPin(D2)); + matrix_row_t data = ~(pin_states << 1 | gpio_read_pin(D2)); bool changed = current_matrix[0] != data; current_matrix[0] = data; diff --git a/keyboards/gl516/a52gl/matrix.c b/keyboards/gl516/a52gl/matrix.c index 1a97fdfd614..b4b8de5d675 100644 --- a/keyboards/gl516/a52gl/matrix.c +++ b/keyboards/gl516/a52gl/matrix.c @@ -83,7 +83,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; 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); @@ -111,7 +111,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[tmp]; // 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[tmp] |= (MATRIX_ROW_SHIFTER << current_col); diff --git a/keyboards/gl516/j73gl/matrix.c b/keyboards/gl516/j73gl/matrix.c index 1a97fdfd614..b4b8de5d675 100644 --- a/keyboards/gl516/j73gl/matrix.c +++ b/keyboards/gl516/j73gl/matrix.c @@ -83,7 +83,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; 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); @@ -111,7 +111,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[tmp]; // 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[tmp] |= (MATRIX_ROW_SHIFTER << current_col); diff --git a/keyboards/gl516/n51gl/matrix.c b/keyboards/gl516/n51gl/matrix.c index 1a97fdfd614..b4b8de5d675 100644 --- a/keyboards/gl516/n51gl/matrix.c +++ b/keyboards/gl516/n51gl/matrix.c @@ -83,7 +83,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; 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); @@ -111,7 +111,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[tmp]; // 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[tmp] |= (MATRIX_ROW_SHIFTER << current_col); diff --git a/keyboards/gmmk/numpad/matrix.c b/keyboards/gmmk/numpad/matrix.c index 99adb38f184..0cc62e90b4e 100644 --- a/keyboards/gmmk/numpad/matrix.c +++ b/keyboards/gmmk/numpad/matrix.c @@ -44,7 +44,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/halfcliff/matrix.c b/keyboards/halfcliff/matrix.c index fd18fd27bda..7f644401751 100644 --- a/keyboards/halfcliff/matrix.c +++ b/keyboards/halfcliff/matrix.c @@ -86,7 +86,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_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); @@ -141,7 +141,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 { diff --git a/keyboards/handwired/lagrange/lagrange.c b/keyboards/handwired/lagrange/lagrange.c index 0c76512c578..afd65a4f607 100644 --- a/keyboards/handwired/lagrange/lagrange.c +++ b/keyboards/handwired/lagrange/lagrange.c @@ -35,7 +35,7 @@ bool is_keyboard_master(void) { static int8_t is_master = -1; if (is_master < 0) { - while (readPin(SPI_SS_PIN)) { + while (gpio_read_pin(SPI_SS_PIN)) { if (USB_Device_IsAddressSet()) { is_master = 1; return is_master; diff --git a/keyboards/handwired/owlet60/matrix.c b/keyboards/handwired/owlet60/matrix.c index b233dd7a526..f0582bd5de7 100644 --- a/keyboards/handwired/owlet60/matrix.c +++ b/keyboards/handwired/owlet60/matrix.c @@ -173,7 +173,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // Select the col pin to read (active low) select_col_analog(col_index); wait_us(30); - uint8_t pin_state = readPin(dat_pin); + uint8_t pin_state = gpio_read_pin(dat_pin); // Populate the matrix row with the state of the col pin current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); diff --git a/keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c b/keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c index 8a303714cf0..7c01196f5fa 100644 --- a/keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c +++ b/keyboards/handwired/symmetric70_proto/matrix_debug/matrix.c @@ -94,7 +94,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_row_value |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); + current_row_value |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); } } @@ -145,7 +145,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) writePin(MATRIX_MUL_SELECT, col_sel[col_index]); waitInputPinDelay(); # endif - 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_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); @@ -178,7 +178,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) writePin(MATRIX_MUL_SELECT, col_sel[col_index]); waitInputPinDelay(); # endif - while (readPin(col_pins[col_index]) == 0) { + while (gpio_read_pin(col_pins[col_index]) == 0) { } MATRIX_DEBUG_DELAY_END(); } @@ -197,7 +197,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) writePin(MATRIX_MUL_SELECT, col_sel[col_index]); waitInputPinDelay(); # endif - state |= (readPin(col_pins[col_index]) == 0); + state |= (gpio_read_pin(col_pins[col_index]) == 0); } MATRIX_DEBUG_DELAY_END(); } while (state); @@ -251,7 +251,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); key_pressed = true; diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c index a0c3ee0f4e4..a939f721020 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c @@ -19,7 +19,7 @@ void keyboard_pre_init_sub(void) { setPinInputHigh(A0); } void matrix_scan_sub_kb(void) { - if (!readPin(A0)) { + if (!gpio_read_pin(A0)) { reset_keyboard(); } } @@ -44,7 +44,7 @@ __attribute__((weak)) void bootmagic_scan(void) { } #endif - if (matrix_get_row(row) & (1 << col) || !readPin(A0)) { + if (matrix_get_row(row) & (1 << col) || !gpio_read_pin(A0)) { eeconfig_disable(); bootloader_jump(); } @@ -55,7 +55,7 @@ __attribute__((weak)) void bootmagic_scan(void) { bool usb_vbus_state(void) { setPinInputLow(USB_VBUS_PIN); wait_us(5); - return readPin(USB_VBUS_PIN); + return gpio_read_pin(USB_VBUS_PIN); } #endif diff --git a/keyboards/hazel/bad_wings/matrix.c b/keyboards/hazel/bad_wings/matrix.c index 496bebd58f9..2e2aea8f274 100644 --- a/keyboards/hazel/bad_wings/matrix.c +++ b/keyboards/hazel/bad_wings/matrix.c @@ -117,7 +117,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { matrix_io_delay(); for (int r = 0; r < SHIFTREG_ROWS; r++) { - current_matrix[r] |= ((readPin(rowPinsSR[r]) ? 1 : 0) << c); + current_matrix[r] |= ((gpio_read_pin(rowPinsSR[r]) ? 1 : 0) << c); } } diff --git a/keyboards/hhkb/yang/matrix.c b/keyboards/hhkb/yang/matrix.c index f0eccc899dc..1efa8d16577 100644 --- a/keyboards/hhkb/yang/matrix.c +++ b/keyboards/hhkb/yang/matrix.c @@ -31,10 +31,10 @@ static uint32_t matrix_last_modified = 0; static inline void key_strobe_high(void) { writePinLow(B6); } static inline void key_strobe_low(void) { writePinHigh(B6); } -static inline bool key_state(void) { return readPin(D7); } +static inline bool key_state(void) { return gpio_read_pin(D7); } static inline void key_prev_on(void) { writePinHigh(B7); } static inline void key_prev_off(void) { writePinLow(B7); } -static inline bool key_power_state(void) { return !readPin(D6); } +static inline bool key_power_state(void) { return !gpio_read_pin(D6); } static inline void suspend_power_down_longer(void) { uint8_t times = 60; diff --git a/keyboards/hineybush/hbcp/matrix.c b/keyboards/hineybush/hbcp/matrix.c index d493a7e9ef6..5eabd238ac8 100644 --- a/keyboards/hineybush/hbcp/matrix.c +++ b/keyboards/hineybush/hbcp/matrix.c @@ -50,7 +50,7 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan // 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); @@ -82,7 +82,7 @@ static matrix_row_t last_matrix[MATRIX_ROWS]; // raw values of last scan 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); } diff --git a/keyboards/ingrained/matrix.c b/keyboards/ingrained/matrix.c index 3ba9d8dcf3b..60a094b3fca 100644 --- a/keyboards/ingrained/matrix.c +++ b/keyboards/ingrained/matrix.c @@ -192,7 +192,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); diff --git a/keyboards/jones/v03/matrix.c b/keyboards/jones/v03/matrix.c index efcd7043e64..f8d05b49550 100644 --- a/keyboards/jones/v03/matrix.c +++ b/keyboards/jones/v03/matrix.c @@ -63,7 +63,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // skip reading when index equals (= pin itself) if (col_index != current_row) { // Check col pin pin_state - if (readPin(col_pins[col_index]) == 0) { + if (gpio_read_pin(col_pins[col_index]) == 0) { // Pin LO, set col bit current_matrix[current_row] |= (ROW_SHIFTER << col_index); } else { diff --git a/keyboards/jones/v03_1/matrix.c b/keyboards/jones/v03_1/matrix.c index efcd7043e64..f8d05b49550 100644 --- a/keyboards/jones/v03_1/matrix.c +++ b/keyboards/jones/v03_1/matrix.c @@ -63,7 +63,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // skip reading when index equals (= pin itself) if (col_index != current_row) { // Check col pin pin_state - if (readPin(col_pins[col_index]) == 0) { + if (gpio_read_pin(col_pins[col_index]) == 0) { // Pin LO, set col bit current_matrix[current_row] |= (ROW_SHIFTER << col_index); } else { diff --git a/keyboards/joshajohnson/hub16/matrix.c b/keyboards/joshajohnson/hub16/matrix.c index 4f32070e66e..d549eba93e3 100644 --- a/keyboards/joshajohnson/hub16/matrix.c +++ b/keyboards/joshajohnson/hub16/matrix.c @@ -67,7 +67,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); @@ -115,8 +115,8 @@ static bool read_encoder_switches(matrix_row_t current_matrix[], uint8_t current bool btn_2_rise = 0; btn_1_array <<= 1; btn_2_array <<= 1; - btn_1_array |= readPin(SWITCH_1); - btn_2_array |= readPin(SWITCH_2); + btn_1_array |= gpio_read_pin(SWITCH_1); + btn_2_array |= gpio_read_pin(SWITCH_2); (btn_1_array == 0b01111111) ? (btn_1_rise = 1) : (btn_1_rise = 0); (btn_2_array == 0b01111111) ? (btn_2_rise = 1) : (btn_2_rise = 0); diff --git a/keyboards/kagizaraya/chidori/board.c b/keyboards/kagizaraya/chidori/board.c index 34e57a88741..abe1dc388a1 100644 --- a/keyboards/kagizaraya/chidori/board.c +++ b/keyboards/kagizaraya/chidori/board.c @@ -282,7 +282,7 @@ static bool board_read_cols_on_master_row(board_info_t* board, matrix_row_t curr wait_us(30); for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - uint8_t pin_state = readPin(board->col_pins[col_index]); + uint8_t pin_state = gpio_read_pin(board->col_pins[col_index]); current_matrix[row] |= pin_state ? 0 : (1 << col_index); } board_unselect_master_row(board, board_row); diff --git a/keyboards/kakunpc/angel64/alpha/matrix.c b/keyboards/kakunpc/angel64/alpha/matrix.c index 7abc50005b6..06d02906d3d 100644 --- a/keyboards/kakunpc/angel64/alpha/matrix.c +++ b/keyboards/kakunpc/angel64/alpha/matrix.c @@ -169,7 +169,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; 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 : (ROW_SHIFTER << col_index); @@ -197,7 +197,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[tmp]; // 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[tmp] |= (ROW_SHIFTER << current_col); diff --git a/keyboards/kakunpc/angel64/rev1/matrix.c b/keyboards/kakunpc/angel64/rev1/matrix.c index 7abc50005b6..06d02906d3d 100644 --- a/keyboards/kakunpc/angel64/rev1/matrix.c +++ b/keyboards/kakunpc/angel64/rev1/matrix.c @@ -169,7 +169,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; 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 : (ROW_SHIFTER << col_index); @@ -197,7 +197,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[tmp]; // 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[tmp] |= (ROW_SHIFTER << current_col); diff --git a/keyboards/kakunpc/choc_taro/matrix.c b/keyboards/kakunpc/choc_taro/matrix.c index 02421551da5..707e3cfce86 100644 --- a/keyboards/kakunpc/choc_taro/matrix.c +++ b/keyboards/kakunpc/choc_taro/matrix.c @@ -88,7 +88,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; 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 : (ROW_SHIFTER << col_index); @@ -114,7 +114,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[tmp]; // 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[tmp] |= (ROW_SHIFTER << current_col); } else { diff --git a/keyboards/kakunpc/thedogkeyboard/matrix.c b/keyboards/kakunpc/thedogkeyboard/matrix.c index 7abc50005b6..06d02906d3d 100644 --- a/keyboards/kakunpc/thedogkeyboard/matrix.c +++ b/keyboards/kakunpc/thedogkeyboard/matrix.c @@ -169,7 +169,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; 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 : (ROW_SHIFTER << col_index); @@ -197,7 +197,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[tmp]; // 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[tmp] |= (ROW_SHIFTER << current_col); diff --git a/keyboards/kbdmania/kmac/matrix.c b/keyboards/kbdmania/kmac/matrix.c index 65698670325..99b46faeed5 100644 --- a/keyboards/kbdmania/kmac/matrix.c +++ b/keyboards/kbdmania/kmac/matrix.c @@ -146,7 +146,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) // Check row pin state // Use the otherwise unused row: 3, col: 0 for caps lock if (row_index == 3 && current_col == 0) { - if (readPin(E2) == 0) { + if (gpio_read_pin(E2) == 0) { // Pin LO, set col bit current_matrix[row_index] |= (ROW_SHIFTER << current_col); } else { @@ -154,7 +154,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); } } else { - if (readPin(row_pins[row_index]) == 0) { + if (gpio_read_pin(row_pins[row_index]) == 0) { // Pin HI, clear col bit current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); } else { diff --git a/keyboards/kbdmania/kmac_pad/matrix.c b/keyboards/kbdmania/kmac_pad/matrix.c index 476e40f5144..48f803dc87c 100644 --- a/keyboards/kbdmania/kmac_pad/matrix.c +++ b/keyboards/kbdmania/kmac_pad/matrix.c @@ -51,7 +51,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) if (current_col == 0) { matrix_row_t last_row_value = current_matrix[0]; - if (readPin(row_pins[0]) == 0) { + if (gpio_read_pin(row_pins[0]) == 0) { // Pin LO, set col bit current_matrix[0] |= (1 << current_col); } else { @@ -69,7 +69,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) for (uint8_t row_index = 1; row_index < MATRIX_ROWS; row_index++) { matrix_row_t last_row_value = current_matrix[row_index]; - if (readPin(row_pins[row_index]) == 0) { + if (gpio_read_pin(row_pins[row_index]) == 0) { // Pin HI, clear col bit current_matrix[row_index] &= ~(1 << current_col); } else { diff --git a/keyboards/keychron/c2_pro/matrix.c b/keyboards/keychron/c2_pro/matrix.c index 5065f97aa7d..e6510addb31 100644 --- a/keyboards/keychron/c2_pro/matrix.c +++ b/keyboards/keychron/c2_pro/matrix.c @@ -61,7 +61,7 @@ static inline void setPinInput_high(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/q10/matrix.c b/keyboards/keychron/q10/matrix.c index 5c035b0e42e..d2d84461bdd 100644 --- a/keyboards/keychron/q10/matrix.c +++ b/keyboards/keychron/q10/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/q12/matrix.c b/keyboards/keychron/q12/matrix.c index 8229517fd9c..fd8975fb3ae 100644 --- a/keyboards/keychron/q12/matrix.c +++ b/keyboards/keychron/q12/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/q1v2/matrix.c b/keyboards/keychron/q1v2/matrix.c index d008a793841..98a888e9b26 100644 --- a/keyboards/keychron/q1v2/matrix.c +++ b/keyboards/keychron/q1v2/matrix.c @@ -54,7 +54,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/q3/matrix.c b/keyboards/keychron/q3/matrix.c index 26830780ffe..1dcda87b948 100644 --- a/keyboards/keychron/q3/matrix.c +++ b/keyboards/keychron/q3/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/q5/matrix.c b/keyboards/keychron/q5/matrix.c index 28ef877504a..32f8eeeb3a6 100644 --- a/keyboards/keychron/q5/matrix.c +++ b/keyboards/keychron/q5/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/q6/matrix.c b/keyboards/keychron/q6/matrix.c index 11f3432e6b1..85071d4525a 100644 --- a/keyboards/keychron/q6/matrix.c +++ b/keyboards/keychron/q6/matrix.c @@ -67,7 +67,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/q65/matrix.c b/keyboards/keychron/q65/matrix.c index 5785f5d5709..05e2c6ef48e 100644 --- a/keyboards/keychron/q65/matrix.c +++ b/keyboards/keychron/q65/matrix.c @@ -60,7 +60,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/v1/matrix.c b/keyboards/keychron/v1/matrix.c index 82a883834f8..55665c8ef42 100644 --- a/keyboards/keychron/v1/matrix.c +++ b/keyboards/keychron/v1/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/v10/matrix.c b/keyboards/keychron/v10/matrix.c index 9269fed8d66..b2265d93e98 100644 --- a/keyboards/keychron/v10/matrix.c +++ b/keyboards/keychron/v10/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/v3/matrix.c b/keyboards/keychron/v3/matrix.c index 44a1676afa9..74b751d50fb 100644 --- a/keyboards/keychron/v3/matrix.c +++ b/keyboards/keychron/v3/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/v5/matrix.c b/keyboards/keychron/v5/matrix.c index ced84428818..0f8e1ce0908 100644 --- a/keyboards/keychron/v5/matrix.c +++ b/keyboards/keychron/v5/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/keychron/v6/matrix.c b/keyboards/keychron/v6/matrix.c index 9269fed8d66..b2265d93e98 100644 --- a/keyboards/keychron/v6/matrix.c +++ b/keyboards/keychron/v6/matrix.c @@ -55,7 +55,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/kinesis/nguyenvietyen/matrix.c b/keyboards/kinesis/nguyenvietyen/matrix.c index d6ea67da681..f6f9b7d7bbb 100644 --- a/keyboards/kinesis/nguyenvietyen/matrix.c +++ b/keyboards/kinesis/nguyenvietyen/matrix.c @@ -10,10 +10,10 @@ static matrix_row_t read_row(uint8_t row) { // keypad and program buttons if (row == 12) { - return ~(readPin(B4) | (readPin(B5) << 1) | 0b11111100); + return ~(gpio_read_pin(B4) | (gpio_read_pin(B5) << 1) | 0b11111100); } - return ~(readPin(B6) | readPin(B2) << 1 | readPin(B3) << 2 | readPin(B1) << 3 | readPin(F7) << 4 | readPin(F6) << 5 | readPin(F5) << 6 | readPin(F4) << 7); + return ~(gpio_read_pin(B6) | gpio_read_pin(B2) << 1 | gpio_read_pin(B3) << 2 | gpio_read_pin(B1) << 3 | gpio_read_pin(F7) << 4 | gpio_read_pin(F6) << 5 | gpio_read_pin(F5) << 6 | gpio_read_pin(F4) << 7); } static void unselect_rows(void) { diff --git a/keyboards/ktec/ergodone/matrix.c b/keyboards/ktec/ergodone/matrix.c index cb845db1bc7..20444209773 100644 --- a/keyboards/ktec/ergodone/matrix.c +++ b/keyboards/ktec/ergodone/matrix.c @@ -97,13 +97,13 @@ static void init_cols(void) { static matrix_row_t read_cols(void) { // clang-format off return expander_read_row() | - (readPin(D3) ? 0 : (1<<6)) | - (readPin(D2) ? 0 : (1<<5)) | - (readPin(D4) ? 0 : (1<<4)) | - (readPin(C6) ? 0 : (1<<3)) | - (readPin(D7) ? 0 : (1<<2)) | - (readPin(E6) ? 0 : (1<<1)) | - (readPin(B4) ? 0 : (1<<0)) ; + (gpio_read_pin(D3) ? 0 : (1<<6)) | + (gpio_read_pin(D2) ? 0 : (1<<5)) | + (gpio_read_pin(D4) ? 0 : (1<<4)) | + (gpio_read_pin(C6) ? 0 : (1<<3)) | + (gpio_read_pin(D7) ? 0 : (1<<2)) | + (gpio_read_pin(E6) ? 0 : (1<<1)) | + (gpio_read_pin(B4) ? 0 : (1<<0)) ; // clang-format on } diff --git a/keyboards/lz/erghost/matrix.c b/keyboards/lz/erghost/matrix.c index 6b7d091cb7e..1ab85cff247 100644 --- a/keyboards/lz/erghost/matrix.c +++ b/keyboards/lz/erghost/matrix.c @@ -306,7 +306,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 { diff --git a/keyboards/macrocat/macrocat.c b/keyboards/macrocat/macrocat.c index f00bb014101..8e6960e9526 100644 --- a/keyboards/macrocat/macrocat.c +++ b/keyboards/macrocat/macrocat.c @@ -133,7 +133,7 @@ void matrix_init_kb(void) { } void matrix_scan_kb(void) { matrix_scan_user(); - if (readPin(ENCODER_SWITCH)) { + if (gpio_read_pin(ENCODER_SWITCH)) { if (encoder_pressed) { // release switch encoder_pressed = 0; encoder_press_combo += 1; diff --git a/keyboards/matrix/m12og/rev1/matrix.c b/keyboards/matrix/m12og/rev1/matrix.c index 9c36153da10..37e1e8eccfc 100644 --- a/keyboards/matrix/m12og/rev1/matrix.c +++ b/keyboards/matrix/m12og/rev1/matrix.c @@ -58,7 +58,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 { diff --git a/keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c b/keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c index 37046790feb..56038d2ef4e 100644 --- a/keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c +++ b/keyboards/mechlovin/adelais/standard_led/avr/rev1/matrix.c @@ -53,7 +53,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); + current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); } } @@ -322,7 +322,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 { diff --git a/keyboards/mechlovin/infinity87/rev2/matrix.c b/keyboards/mechlovin/infinity87/rev2/matrix.c index b1b0d20654c..810d493181b 100644 --- a/keyboards/mechlovin/infinity87/rev2/matrix.c +++ b/keyboards/mechlovin/infinity87/rev2/matrix.c @@ -53,7 +53,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); + current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); } } @@ -347,7 +347,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 { diff --git a/keyboards/mechlovin/infinity875/matrix.c b/keyboards/mechlovin/infinity875/matrix.c index b1b0d20654c..810d493181b 100644 --- a/keyboards/mechlovin/infinity875/matrix.c +++ b/keyboards/mechlovin/infinity875/matrix.c @@ -53,7 +53,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); + current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); } } @@ -347,7 +347,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 { diff --git a/keyboards/mechlovin/olly/bb/matrix.c b/keyboards/mechlovin/olly/bb/matrix.c index e045299bae2..1a698a66a5c 100644 --- a/keyboards/mechlovin/olly/bb/matrix.c +++ b/keyboards/mechlovin/olly/bb/matrix.c @@ -326,7 +326,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 { diff --git a/keyboards/mechlovin/olly/jf/rev1/matrix.c b/keyboards/mechlovin/olly/jf/rev1/matrix.c index c01879c9a54..91f277fd442 100644 --- a/keyboards/mechlovin/olly/jf/rev1/matrix.c +++ b/keyboards/mechlovin/olly/jf/rev1/matrix.c @@ -53,7 +53,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); + current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); } } @@ -97,7 +97,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; 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); @@ -416,7 +416,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 { diff --git a/keyboards/mechlovin/serratus/matrix.c b/keyboards/mechlovin/serratus/matrix.c index b1b0d20654c..810d493181b 100644 --- a/keyboards/mechlovin/serratus/matrix.c +++ b/keyboards/mechlovin/serratus/matrix.c @@ -53,7 +53,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); + current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index); } } @@ -347,7 +347,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 { diff --git a/keyboards/mexsistor/ludmila/matrix.c b/keyboards/mexsistor/ludmila/matrix.c index 338286a7db6..9b728ac6f4f 100644 --- a/keyboards/mexsistor/ludmila/matrix.c +++ b/keyboards/mexsistor/ludmila/matrix.c @@ -67,7 +67,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); @@ -111,7 +111,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 diff --git a/keyboards/miiiw/blackio83/blackio83.c b/keyboards/miiiw/blackio83/blackio83.c index 8c80ebd73c7..6d7cbfd3121 100644 --- a/keyboards/miiiw/blackio83/blackio83.c +++ b/keyboards/miiiw/blackio83/blackio83.c @@ -133,7 +133,7 @@ uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) { if(timer_elapsed32(pmu_timer) > 3000) { pmu_timer = timer_read32(); writePinLow(MWPROTO_WAKEUP_PIN); - if(readPin(MWPROTO_STATUS_PIN)) + if(gpio_read_pin(MWPROTO_STATUS_PIN)) wait_us(500); else wait_us(1500); @@ -152,7 +152,7 @@ uint32_t loop_10Hz(uint32_t trigger_time, void *cb_arg) { if(restore_tick++ > 50) { restore_tick = 0; writePinLow(MWPROTO_WAKEUP_PIN); - if(readPin(MWPROTO_STATUS_PIN)) + if(gpio_read_pin(MWPROTO_STATUS_PIN)) wait_us(500); else wait_us(1500); diff --git a/keyboards/miiiw/blackio83/matrix.c b/keyboards/miiiw/blackio83/matrix.c index 841ff3c16e6..b83233a4f3d 100644 --- a/keyboards/miiiw/blackio83/matrix.c +++ b/keyboards/miiiw/blackio83/matrix.c @@ -91,7 +91,7 @@ void matrix_power_down(void) { static uint8_t read_rows(void) { uint8_t row_value = 0; for(uint8_t row = 0; row < MATRIX_ROWS; row++) { - row_value |= (readPin(row_pins[row]) << row); + row_value |= (gpio_read_pin(row_pins[row]) << row); } return row_value; } diff --git a/keyboards/nullbitsco/nibble/matrix.c b/keyboards/nullbitsco/nibble/matrix.c index 496c5dbe322..7ecf49c33be 100644 --- a/keyboards/nullbitsco/nibble/matrix.c +++ b/keyboards/nullbitsco/nibble/matrix.c @@ -59,7 +59,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]; - if (!readPin(row_pins[row_index])) + if (!gpio_read_pin(row_pins[row_index])) { current_matrix[row_index] |= (COL_SHIFTER << current_col); } diff --git a/keyboards/nullbitsco/snap/matrix.c b/keyboards/nullbitsco/snap/matrix.c index ceb9cd89841..c0e9c2eb615 100644 --- a/keyboards/nullbitsco/snap/matrix.c +++ b/keyboards/nullbitsco/snap/matrix.c @@ -74,7 +74,7 @@ static void read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) // Read each row sequentially for (uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) { - if (readPin(row_pins[row_index]) == 0) { + if (gpio_read_pin(row_pins[row_index]) == 0) { current_matrix[row_index] |= (COL_SHIFTER << current_col); } else { current_matrix[row_index] &= ~(COL_SHIFTER << current_col); @@ -85,7 +85,7 @@ static void read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) static void read_ext_pin(matrix_row_t current_matrix[]) { // Read the state of the extended matrix pin if (!isLeftHand) { - if (readPin(MATRIX_EXT_PIN_RIGHT) == 0) { + if (gpio_read_pin(MATRIX_EXT_PIN_RIGHT) == 0) { current_matrix[EXT_PIN_ROW] |= (COL_SHIFTER << EXT_PIN_COL); } else { current_matrix[EXT_PIN_ROW] &= ~(COL_SHIFTER << EXT_PIN_COL); diff --git a/keyboards/om60/matrix.c b/keyboards/om60/matrix.c index 36867804689..e83865509f5 100644 --- a/keyboards/om60/matrix.c +++ b/keyboards/om60/matrix.c @@ -91,7 +91,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; 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 : (ROW_SHIFTER << col_index); @@ -119,7 +119,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[tmp]; // 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[tmp] |= (ROW_SHIFTER << current_col); diff --git a/keyboards/pica40/rev2/rev2.c b/keyboards/pica40/rev2/rev2.c index 2ee73dcc6b8..7bf4707ca32 100644 --- a/keyboards/pica40/rev2/rev2.c +++ b/keyboards/pica40/rev2/rev2.c @@ -11,7 +11,7 @@ // custom handler that returns encoder B pin status from slave side void encoder_sync_slave_handler(uint8_t in_buflen, const void *in_data, uint8_t out_buflen, void *out_data) { - *(uint8_t *)out_data = readPin(ENCODER_PIN_B) ? 1 : 0; + *(uint8_t *)out_data = gpio_read_pin(ENCODER_PIN_B) ? 1 : 0; } void encoder_quadrature_init_pin(uint8_t index, bool pad_b) {} @@ -22,7 +22,7 @@ uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) { transaction_rpc_recv(ENCODER_SYNC, sizeof(data), &data); return data; } - return readPin(ENCODER_PIN_A) ? 1 : 0; + return gpio_read_pin(ENCODER_PIN_A) ? 1 : 0; } #endif // ENCODER_ENABLE diff --git a/keyboards/planck/rev6_drop/matrix.c b/keyboards/planck/rev6_drop/matrix.c index e31e473ae25..34bdcc3f04d 100644 --- a/keyboards/planck/rev6_drop/matrix.c +++ b/keyboards/planck/rev6_drop/matrix.c @@ -51,7 +51,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { // read row data for (int row = 0; row < MATRIX_ROWS; row++) { - data |= (readPin(matrix_row_pins[row]) << row); + data |= (gpio_read_pin(matrix_row_pins[row]) << row); } // unstrobe col diff --git a/keyboards/planck/rev7/matrix.c b/keyboards/planck/rev7/matrix.c index 350ce93ce04..1085480802e 100644 --- a/keyboards/planck/rev7/matrix.c +++ b/keyboards/planck/rev7/matrix.c @@ -89,7 +89,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { // read row data for (int row = 0; row < MATRIX_ROWS; row++) { - data |= (readPin(matrix_row_pins[row]) << row); + data |= (gpio_read_pin(matrix_row_pins[row]) << row); } // unstrobe col @@ -117,7 +117,7 @@ uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) { setPinInputHigh(pin); writePinLow(matrix_row_pins[index]); wait_us(10); - uint8_t ret = readPin(pin) ? 1 : 0; + uint8_t ret = gpio_read_pin(pin) ? 1 : 0; setPinInputLow(matrix_row_pins[index]); setPinInputLow(pin); return ret; diff --git a/keyboards/qvex/lynepad/lynepad.c b/keyboards/qvex/lynepad/lynepad.c index cc69e12240c..75a67624b84 100644 --- a/keyboards/qvex/lynepad/lynepad.c +++ b/keyboards/qvex/lynepad/lynepad.c @@ -40,18 +40,18 @@ int16_t enc2RightPrev = 1; void matrix_scan_kb(void) { enc1CenterPrev = enc1Center; - enc1Center = readPin(PIN_TW_SW); + enc1Center = gpio_read_pin(PIN_TW_SW); enc2CenterPrev = enc2Center; - enc2Center = readPin(PIN_RJ_SW); + enc2Center = gpio_read_pin(PIN_RJ_SW); enc2UpPrev = enc2Up; - enc2Up = readPin(PIN_RJ_DIR_A); + enc2Up = gpio_read_pin(PIN_RJ_DIR_A); enc2DownPrev = enc2Down; - enc2Down = readPin(PIN_RJ_DIR_C); + enc2Down = gpio_read_pin(PIN_RJ_DIR_C); enc2LeftPrev = enc2Left; - enc2Left = readPin(PIN_RJ_DIR_B); + enc2Left = gpio_read_pin(PIN_RJ_DIR_B); enc2RightPrev = enc2Right; - enc2Right = readPin(PIN_RJ_DIR_D); + enc2Right = gpio_read_pin(PIN_RJ_DIR_D); // Ensure any user customizations are called (for some reason this wasn't happening by default) matrix_scan_user(); diff --git a/keyboards/qvex/lynepad2/matrix.c b/keyboards/qvex/lynepad2/matrix.c index 878ee6e2f72..8da35022563 100644 --- a/keyboards/qvex/lynepad2/matrix.c +++ b/keyboards/qvex/lynepad2/matrix.c @@ -67,7 +67,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) wait_us(30); for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - uint8_t pin_state = readPin(col_pins[col_index]); + uint8_t pin_state = gpio_read_pin(col_pins[col_index]); current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); } @@ -83,16 +83,16 @@ static bool read_encoder_switches(matrix_row_t current_matrix[]) { current_matrix[3] = 0; current_matrix[4] = 0; - current_matrix[4] |= !readPin(PIN_TC) ? (1 << 1) : 0; + current_matrix[4] |= !gpio_read_pin(PIN_TC) ? (1 << 1) : 0; - if (!readPin(PIN_JC)) { - if (!readPin(PIN_JU)) { + if (!gpio_read_pin(PIN_JC)) { + if (!gpio_read_pin(PIN_JU)) { current_matrix[3] |= (1 << 0); - } else if (!readPin(PIN_JD)) { + } else if (!gpio_read_pin(PIN_JD)) { current_matrix[3] |= (1 << 1); - } else if (!readPin(PIN_JL)) { + } else if (!gpio_read_pin(PIN_JL)) { current_matrix[3] |= (1 << 2); - } else if (!readPin(PIN_JR)) { + } else if (!gpio_read_pin(PIN_JR)) { current_matrix[3] |= (1 << 3); } else { current_matrix[4] |= (1 << 0); diff --git a/keyboards/rate/pistachio_pro/matrix.c b/keyboards/rate/pistachio_pro/matrix.c index 6cbfb6dfea1..9579e67f2cc 100644 --- a/keyboards/rate/pistachio_pro/matrix.c +++ b/keyboards/rate/pistachio_pro/matrix.c @@ -83,7 +83,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 / 2; col_index++) { // Check row pin state - if (readPin(col_pins[col_index])) { + if (gpio_read_pin(col_pins[col_index])) { // Pin HI, clear col bit current_matrix[current_row] &= ~(MATRIX_ROW_SHIFTER << col_index); } else { @@ -111,7 +111,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])) { + if (gpio_read_pin(row_pins[row_index])) { // Pin HI, clear col bit current_matrix[row_index] &= ~(MATRIX_ROW_SHIFTER << ( current_col + MATRIX_COLS/2)); } else { diff --git a/keyboards/redscarf_iiplus/verb/matrix.c b/keyboards/redscarf_iiplus/verb/matrix.c index aa2cd8e5107..43ab9d39a03 100755 --- a/keyboards/redscarf_iiplus/verb/matrix.c +++ b/keyboards/redscarf_iiplus/verb/matrix.c @@ -130,7 +130,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); + current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (ROW_SHIFTER << col_index); } } @@ -241,7 +241,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; 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 : (ROW_SHIFTER << col_index); @@ -296,7 +296,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] |= (ROW_SHIFTER << current_col); diff --git a/keyboards/redscarf_iiplus/verc/matrix.c b/keyboards/redscarf_iiplus/verc/matrix.c index aa2cd8e5107..43ab9d39a03 100755 --- a/keyboards/redscarf_iiplus/verc/matrix.c +++ b/keyboards/redscarf_iiplus/verc/matrix.c @@ -130,7 +130,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); + current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (ROW_SHIFTER << col_index); } } @@ -241,7 +241,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; 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 : (ROW_SHIFTER << col_index); @@ -296,7 +296,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] |= (ROW_SHIFTER << current_col); diff --git a/keyboards/redscarf_iiplus/verd/matrix.c b/keyboards/redscarf_iiplus/verd/matrix.c index 382847e9419..7f0ad17b4d3 100644 --- a/keyboards/redscarf_iiplus/verd/matrix.c +++ b/keyboards/redscarf_iiplus/verd/matrix.c @@ -130,7 +130,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; col_index++) { pin_t pin = direct_pins[current_row][col_index]; if (pin != NO_PIN) { - current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index); + current_matrix[current_row] |= gpio_read_pin(pin) ? 0 : (ROW_SHIFTER << col_index); } } @@ -241,7 +241,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; 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 : (ROW_SHIFTER << col_index); @@ -296,7 +296,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] |= (ROW_SHIFTER << current_col); diff --git a/keyboards/ryanskidmore/rskeys100/matrix.c b/keyboards/ryanskidmore/rskeys100/matrix.c index faefb29c84e..560e3e0811b 100644 --- a/keyboards/ryanskidmore/rskeys100/matrix.c +++ b/keyboards/ryanskidmore/rskeys100/matrix.c @@ -65,12 +65,12 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { } static uint8_t read_rows(void) { - return (readPin(ROW_F) << 5) - | (readPin(ROW_E) << 4) - | (readPin(ROW_D) << 3) - | (readPin(ROW_C) << 2) - | (readPin(ROW_B) << 1) - | (readPin(ROW_A) ); + return (gpio_read_pin(ROW_F) << 5) + | (gpio_read_pin(ROW_E) << 4) + | (gpio_read_pin(ROW_D) << 3) + | (gpio_read_pin(ROW_C) << 2) + | (gpio_read_pin(ROW_B) << 1) + | (gpio_read_pin(ROW_A) ); } static void select_col(uint8_t col) { diff --git a/keyboards/snes_macropad/matrix.c b/keyboards/snes_macropad/matrix.c index 28d036aca9c..092cb29f42e 100644 --- a/keyboards/snes_macropad/matrix.c +++ b/keyboards/snes_macropad/matrix.c @@ -70,10 +70,10 @@ static matrix_row_t readRow(size_t row, int setupDelay) { // read the column data const matrix_row_t ret = - (readPin(KBD_COL0) ? 0 : 1 << 0) - | (readPin(KBD_COL1) ? 0 : 1 << 1) - | (readPin(KBD_COL2) ? 0 : 1 << 2) - | (readPin(KBD_COL3) ? 0 : 1 << 3); + (gpio_read_pin(KBD_COL0) ? 0 : 1 << 0) + | (gpio_read_pin(KBD_COL1) ? 0 : 1 << 1) + | (gpio_read_pin(KBD_COL2) ? 0 : 1 << 2) + | (gpio_read_pin(KBD_COL3) ? 0 : 1 << 3); // deselect the row setPinOutput(pin); @@ -111,7 +111,7 @@ static void readSnesController(matrix_row_t current_matrix[]) { // Shift accumulated data and read data pin controller <<= 1; - controller |= readPin(SNES_D0) ? 0 : 1; + controller |= gpio_read_pin(SNES_D0) ? 0 : 1; // todo: maybe read D1 and IO here too // Shift next bit in diff --git a/keyboards/splitkb/aurora/helix/rev1/rev1.c b/keyboards/splitkb/aurora/helix/rev1/rev1.c index da24934eef7..dc87c11846b 100644 --- a/keyboards/splitkb/aurora/helix/rev1/rev1.c +++ b/keyboards/splitkb/aurora/helix/rev1/rev1.c @@ -25,7 +25,7 @@ static enum { UNKNOWN, LEFT, RIGHT } hand_side = UNKNOWN; #if defined(SPLIT_HAND_PIN) // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand setPinInput(SPLIT_HAND_PIN); - hand_side = readPin(SPLIT_HAND_PIN) ? LEFT : RIGHT; + hand_side = gpio_read_pin(SPLIT_HAND_PIN) ? LEFT : RIGHT; return (hand_side == LEFT); #endif hand_side = is_keyboard_master() ? LEFT : RIGHT; diff --git a/keyboards/sthlmkb/lagom/matrix.c b/keyboards/sthlmkb/lagom/matrix.c index d3dc0cb12aa..ba98948864a 100644 --- a/keyboards/sthlmkb/lagom/matrix.c +++ b/keyboards/sthlmkb/lagom/matrix.c @@ -59,7 +59,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]; - if (!readPin(row_pins[row_index])) + if (!gpio_read_pin(row_pins[row_index])) { current_matrix[row_index] |= (COL_SHIFTER << current_col); } diff --git a/keyboards/torn/matrix.c b/keyboards/torn/matrix.c index b674f21d57f..85d5fd9f3e1 100644 --- a/keyboards/torn/matrix.c +++ b/keyboards/torn/matrix.c @@ -60,7 +60,7 @@ static matrix_row_t read_cols(void) { // For each col... for (uint8_t col_index = 0; col_index < SPLIT_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 state |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); diff --git a/keyboards/touchpad/matrix.c b/keyboards/touchpad/matrix.c index 87944cb7cc6..3b90c11b65d 100644 --- a/keyboards/touchpad/matrix.c +++ b/keyboards/touchpad/matrix.c @@ -207,7 +207,7 @@ void touchClearCurrentDetections(void) { //Check interrupt pin uint8_t isTouchChangeDetected(void) { - return !readPin(D2); + return !gpio_read_pin(D2); } uint8_t matrix_scan(void) { diff --git a/keyboards/tzarc/djinn/djinn_portscan_matrix.c b/keyboards/tzarc/djinn/djinn_portscan_matrix.c index ac81ad18c1b..a72419f7d02 100644 --- a/keyboards/tzarc/djinn/djinn_portscan_matrix.c +++ b/keyboards/tzarc/djinn/djinn_portscan_matrix.c @@ -19,7 +19,7 @@ void matrix_wait_for_pin(pin_t pin, uint8_t target_state) { rtcnt_t start = chSysGetRealtimeCounterX(); rtcnt_t end = start + 5000; while (chSysIsCounterWithinX(chSysGetRealtimeCounterX(), start, end)) { - if (readPin(pin) == target_state) { + if (gpio_read_pin(pin) == target_state) { break; } } diff --git a/keyboards/tzarc/ghoul/ghoul.c b/keyboards/tzarc/ghoul/ghoul.c index a97399110c2..387c107bb83 100644 --- a/keyboards/tzarc/ghoul/ghoul.c +++ b/keyboards/tzarc/ghoul/ghoul.c @@ -33,7 +33,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { spi_stop(); // Read from the encoder pushbutton - temp_matrix[5] = readPin(ENCODER_PUSHBUTTON_PIN) ? 1 : 0; + temp_matrix[5] = gpio_read_pin(ENCODER_PUSHBUTTON_PIN) ? 1 : 0; // Check if we've changed, return the last-read data bool changed = memcmp(current_matrix, temp_matrix, sizeof(temp_matrix)) != 0; diff --git a/keyboards/viktus/sp111/matrix.c b/keyboards/viktus/sp111/matrix.c index 33b232dca77..5ceedc88153 100644 --- a/keyboards/viktus/sp111/matrix.c +++ b/keyboards/viktus/sp111/matrix.c @@ -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_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index); diff --git a/keyboards/vitamins_included/rev2/rev2.c b/keyboards/vitamins_included/rev2/rev2.c index d34cdb4fc14..02e90d76024 100644 --- a/keyboards/vitamins_included/rev2/rev2.c +++ b/keyboards/vitamins_included/rev2/rev2.c @@ -8,7 +8,7 @@ bool is_keyboard_left(void) { #elif defined(SPLIT_HAND_PIN) // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand setPinInputHigh(SPLIT_HAND_PIN); - bool x = !readPin(SPLIT_HAND_PIN); + bool x = !gpio_read_pin(SPLIT_HAND_PIN); setPinInput(SPLIT_HAND_PIN); return x; #elif defined(EE_HANDS) diff --git a/keyboards/work_louder/micro/matrix.c b/keyboards/work_louder/micro/matrix.c index 743c788662c..061d8f68a0c 100644 --- a/keyboards/work_louder/micro/matrix.c +++ b/keyboards/work_louder/micro/matrix.c @@ -42,7 +42,7 @@ static inline void setPinInputHigh_atomic(pin_t pin) { static inline uint8_t readMatrixPin(pin_t pin) { if (pin != NO_PIN) { - return readPin(pin); + return gpio_read_pin(pin); } else { return 1; } diff --git a/keyboards/ydkb/grape/matrix.c b/keyboards/ydkb/grape/matrix.c index 700761fa448..dff62fc0bcc 100644 --- a/keyboards/ydkb/grape/matrix.c +++ b/keyboards/ydkb/grape/matrix.c @@ -63,7 +63,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; 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 : (row_shifter << col_index); diff --git a/keyboards/yiancardesigns/barleycorn/matrix.c b/keyboards/yiancardesigns/barleycorn/matrix.c index 9ef29265662..7ad103e8030 100644 --- a/keyboards/yiancardesigns/barleycorn/matrix.c +++ b/keyboards/yiancardesigns/barleycorn/matrix.c @@ -113,7 +113,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) pin_state = port_expander_col_buffer[1] & (1 << 1); break; default : - pin_state = readPin(col_pins[col_index]); + pin_state = gpio_read_pin(col_pins[col_index]); } // Populate the matrix row with the state of the col pin diff --git a/keyboards/yiancardesigns/gingham/matrix.c b/keyboards/yiancardesigns/gingham/matrix.c index d17518b4940..2ce25c7ef76 100644 --- a/keyboards/yiancardesigns/gingham/matrix.c +++ b/keyboards/yiancardesigns/gingham/matrix.c @@ -92,7 +92,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) pin_state = pin_state & (1 << 1); break; default : - pin_state = readPin(col_pins[col_index]); + pin_state = gpio_read_pin(col_pins[col_index]); } // Populate the matrix row with the state of the col pin diff --git a/keyboards/yiancardesigns/seigaiha/matrix.c b/keyboards/yiancardesigns/seigaiha/matrix.c index 55ee239db4c..f70502e4ada 100644 --- a/keyboards/yiancardesigns/seigaiha/matrix.c +++ b/keyboards/yiancardesigns/seigaiha/matrix.c @@ -98,7 +98,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) pin_state = port_expander_col_buffer & (1 << 4); break; default : - pin_state = readPin(col_pins[col_index]); + pin_state = gpio_read_pin(col_pins[col_index]); } // Populate the matrix row with the state of the col pin diff --git a/keyboards/zsa/moonlander/matrix.c b/keyboards/zsa/moonlander/matrix.c index aa97d0721ff..6e7621a6ed1 100644 --- a/keyboards/zsa/moonlander/matrix.c +++ b/keyboards/zsa/moonlander/matrix.c @@ -170,13 +170,13 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { } // read col data data = ( - (readPin(A0) << 0 ) | - (readPin(A1) << 1 ) | - (readPin(A2) << 2 ) | - (readPin(A3) << 3 ) | - (readPin(A6) << 4 ) | - (readPin(A7) << 5 ) | - (readPin(B0) << 6 ) + (gpio_read_pin(A0) << 0 ) | + (gpio_read_pin(A1) << 1 ) | + (gpio_read_pin(A2) << 2 ) | + (gpio_read_pin(A3) << 3 ) | + (gpio_read_pin(A6) << 4 ) | + (gpio_read_pin(A7) << 5 ) | + (gpio_read_pin(B0) << 6 ) ); // unstrobe row switch (row) {