From 5bcf1c923892a3addeb68b121440ee8b857c25d3 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 27 Mar 2024 17:14:05 +1100 Subject: [PATCH] Update GPIO API usage in keyboard code - `setPinInputLow` --- .../tractyl_manuform/5x6_right/f411/f411.c | 2 +- keyboards/hazel/bad_wings/matrix.c | 2 +- keyboards/matrix/m12og/rev1/matrix.c | 6 +++--- keyboards/miiiw/blackio83/blackio83.c | 4 ++-- keyboards/miiiw/blackio83/matrix.c | 8 ++++---- keyboards/planck/rev6_drop/matrix.c | 2 +- keyboards/planck/rev7/matrix.c | 10 +++++----- keyboards/tzarc/ghoul/ghoul.c | 2 +- keyboards/zsa/moonlander/matrix.c | 14 +++++++------- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c index 5e9f0acd642..03fb64b2a9b 100644 --- a/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c +++ b/keyboards/handwired/tractyl_manuform/5x6_right/f411/f411.c @@ -53,7 +53,7 @@ __attribute__((weak)) void bootmagic_scan(void) { #ifdef USB_VBUS_PIN bool usb_vbus_state(void) { - setPinInputLow(USB_VBUS_PIN); + gpio_set_pin_input_low(USB_VBUS_PIN); wait_us(5); return gpio_read_pin(USB_VBUS_PIN); } diff --git a/keyboards/hazel/bad_wings/matrix.c b/keyboards/hazel/bad_wings/matrix.c index a0f96ec5c09..237d26d5cf3 100644 --- a/keyboards/hazel/bad_wings/matrix.c +++ b/keyboards/hazel/bad_wings/matrix.c @@ -83,7 +83,7 @@ void matrix_init_custom(void) { // Set up the initial states for all the row pins for (int r = 0; r < SHIFTREG_ROWS; r++) { // Note: This needs to use the internal pull down resistors, and atmegas do *not* support that - setPinInputLow(rowPinsSR[r]); + gpio_set_pin_input_low(rowPinsSR[r]); } // Set the CS to low by default, and specify as an output pin diff --git a/keyboards/matrix/m12og/rev1/matrix.c b/keyboards/matrix/m12og/rev1/matrix.c index 83c747a7fb8..8bd8b12295b 100644 --- a/keyboards/matrix/m12og/rev1/matrix.c +++ b/keyboards/matrix/m12og/rev1/matrix.c @@ -29,18 +29,18 @@ static void select_col(uint8_t 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]); } } diff --git a/keyboards/miiiw/blackio83/blackio83.c b/keyboards/miiiw/blackio83/blackio83.c index a0cc19d3a6d..0ad160985d0 100644 --- a/keyboards/miiiw/blackio83/blackio83.c +++ b/keyboards/miiiw/blackio83/blackio83.c @@ -56,14 +56,14 @@ void ws2812_poweron(void) { void ws2812_poweroff(void) { if(!p_setup) return; p_setup = false; - setPinInputLow(WS2812_DI_PIN); + gpio_set_pin_input_low(WS2812_DI_PIN); gpio_write_pin_low(RGB_EN_PIN); } void keyboard_pre_init_kb() { keyboard_pre_init_user(); - setPinInputLow(MWPROTO_STATUS_PIN); + gpio_set_pin_input_low(MWPROTO_STATUS_PIN); gpio_set_pin_output(MWPROTO_WAKEUP_PIN); gpio_write_pin_low(MWPROTO_WAKEUP_PIN); wait_ms(2); diff --git a/keyboards/miiiw/blackio83/matrix.c b/keyboards/miiiw/blackio83/matrix.c index 372d8eaa64b..1fbbb8b3a73 100644 --- a/keyboards/miiiw/blackio83/matrix.c +++ b/keyboards/miiiw/blackio83/matrix.c @@ -34,7 +34,7 @@ static pin_t dip_switch_pad[] = DIP_SWITCH_PINS; void matrix_init_custom(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - setPinInputLow(row_pins[row]); + gpio_set_pin_input_low(row_pins[row]); } shift_init(); @@ -65,7 +65,7 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) { void matrix_power_up(void) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { palDisableLineEvent(row_pins[row]); - setPinInputLow(row_pins[row]); + gpio_set_pin_input_low(row_pins[row]); } init_cols(); #ifdef DIP_SWITCH_PINS @@ -78,12 +78,12 @@ void matrix_power_up(void) { void matrix_power_down(void) { unselect_cols(); for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - setPinInputLow(row_pins[row]); + gpio_set_pin_input_low(row_pins[row]); palEnableLineEvent(row_pins[row], PAL_EVENT_MODE_RISING_EDGE); } #ifdef DIP_SWITCH_PINS for (uint8_t i = 1; i < NUMBER_OF_DIP_SWITCHES; i++) { - setPinInputLow(dip_switch_pad[i]); + gpio_set_pin_input_low(dip_switch_pad[i]); } #endif } diff --git a/keyboards/planck/rev6_drop/matrix.c b/keyboards/planck/rev6_drop/matrix.c index eab77ff4d00..c6be8aa4461 100644 --- a/keyboards/planck/rev6_drop/matrix.c +++ b/keyboards/planck/rev6_drop/matrix.c @@ -32,7 +32,7 @@ void matrix_init_custom(void) { // rows for (int i = 0; i < MATRIX_ROWS; i++) { - setPinInputLow(matrix_row_pins[i]); + gpio_set_pin_input_low(matrix_row_pins[i]); } } diff --git a/keyboards/planck/rev7/matrix.c b/keyboards/planck/rev7/matrix.c index 89b7f8ac410..190e1c97c0d 100644 --- a/keyboards/planck/rev7/matrix.c +++ b/keyboards/planck/rev7/matrix.c @@ -51,12 +51,12 @@ void matrix_init_custom(void) { // rows for (int i = 0; i < MATRIX_ROWS; i++) { - setPinInputLow(matrix_row_pins[i]); + gpio_set_pin_input_low(matrix_row_pins[i]); } // encoder A & B setup - setPinInputLow(B12); - setPinInputLow(B13); + gpio_set_pin_input_low(B12); + gpio_set_pin_input_low(B13); #ifndef PLANCK_WATCHDOG_DISABLE wdgInit(); @@ -118,7 +118,7 @@ uint8_t encoder_quadrature_read_pin(uint8_t index, bool pad_b) { gpio_write_pin_low(matrix_row_pins[index]); wait_us(10); uint8_t ret = gpio_read_pin(pin) ? 1 : 0; - setPinInputLow(matrix_row_pins[index]); - setPinInputLow(pin); + gpio_set_pin_input_low(matrix_row_pins[index]); + gpio_set_pin_input_low(pin); return ret; } diff --git a/keyboards/tzarc/ghoul/ghoul.c b/keyboards/tzarc/ghoul/ghoul.c index 2d1968f663b..bbd536dfdb2 100644 --- a/keyboards/tzarc/ghoul/ghoul.c +++ b/keyboards/tzarc/ghoul/ghoul.c @@ -21,7 +21,7 @@ void matrix_init_custom(void) { spi_init(); // Encoder pushbutton - setPinInputLow(ENCODER_PUSHBUTTON_PIN); + gpio_set_pin_input_low(ENCODER_PUSHBUTTON_PIN); } bool matrix_scan_custom(matrix_row_t current_matrix[]) { diff --git a/keyboards/zsa/moonlander/matrix.c b/keyboards/zsa/moonlander/matrix.c index a9b3b7ee333..2c9edd417cd 100644 --- a/keyboards/zsa/moonlander/matrix.c +++ b/keyboards/zsa/moonlander/matrix.c @@ -79,13 +79,13 @@ void matrix_init_custom(void) { gpio_set_pin_output(B15); // inputs - setPinInputLow(A0); - setPinInputLow(A1); - setPinInputLow(A2); - setPinInputLow(A3); - setPinInputLow(A6); - setPinInputLow(A7); - setPinInputLow(B0); + gpio_set_pin_input_low(A0); + gpio_set_pin_input_low(A1); + gpio_set_pin_input_low(A2); + gpio_set_pin_input_low(A3); + gpio_set_pin_input_low(A6); + gpio_set_pin_input_low(A7); + gpio_set_pin_input_low(B0); mcp23018_init(); }