diff options
| author | Ryan | 2024-05-03 07:21:29 +0200 |
|---|---|---|
| committer | GitHub | 2024-05-03 07:21:29 +0200 |
| commit | d09a06a1b354760fd0e64a453abade972900e885 (patch) | |
| tree | 88d94640f4507ac8d7f570607423825bec3c6f89 /keyboards/nullbitsco | |
| parent | 5426a7a129acf2ff5c8b435014747f1238e17965 (diff) | |
Update GPIO API usage in keyboard code (#23361)
Diffstat (limited to 'keyboards/nullbitsco')
| -rw-r--r-- | keyboards/nullbitsco/common/bitc_led.c | 10 | ||||
| -rw-r--r-- | keyboards/nullbitsco/nibble/big_led.c | 24 | ||||
| -rw-r--r-- | keyboards/nullbitsco/nibble/matrix.c | 10 | ||||
| -rw-r--r-- | keyboards/nullbitsco/scramble/v1/v1.c | 10 | ||||
| -rw-r--r-- | keyboards/nullbitsco/snap/matrix.c | 14 |
5 files changed, 34 insertions, 34 deletions
diff --git a/keyboards/nullbitsco/common/bitc_led.c b/keyboards/nullbitsco/common/bitc_led.c index 64d7c7160a..8f91e665f8 100644 --- a/keyboards/nullbitsco/common/bitc_led.c +++ b/keyboards/nullbitsco/common/bitc_led.c @@ -18,17 +18,17 @@ void set_bitc_LED(uint8_t mode) { switch(mode) { case LED_ON: - setPinOutput(PIN_LED); - writePin(PIN_LED, GPIO_STATE_HIGH); + gpio_set_pin_output(PIN_LED); + gpio_write_pin(PIN_LED, GPIO_STATE_HIGH); break; case LED_DIM: - setPinInput(PIN_LED); + gpio_set_pin_input(PIN_LED); break; case LED_OFF: - setPinOutput(PIN_LED); - writePin(PIN_LED, GPIO_STATE_LOW); + gpio_set_pin_output(PIN_LED); + gpio_write_pin(PIN_LED, GPIO_STATE_LOW); break; default: diff --git a/keyboards/nullbitsco/nibble/big_led.c b/keyboards/nullbitsco/nibble/big_led.c index d66a808153..0e61b440b6 100644 --- a/keyboards/nullbitsco/nibble/big_led.c +++ b/keyboards/nullbitsco/nibble/big_led.c @@ -24,13 +24,13 @@ void set_big_LED_rgb(uint8_t r_mode, uint8_t g_mode, uint8_t b_mode) { void set_big_LED_r(uint8_t mode) { switch(mode) { case LED_ON: - setPinOutput(BIG_LED_R_PIN); - writePin(BIG_LED_R_PIN, GPIO_STATE_HIGH); + gpio_set_pin_output(BIG_LED_R_PIN); + gpio_write_pin(BIG_LED_R_PIN, GPIO_STATE_HIGH); break; case LED_OFF: - setPinOutput(BIG_LED_R_PIN); - writePin(BIG_LED_R_PIN, GPIO_STATE_LOW); + gpio_set_pin_output(BIG_LED_R_PIN); + gpio_write_pin(BIG_LED_R_PIN, GPIO_STATE_LOW); break; default: @@ -41,13 +41,13 @@ void set_big_LED_r(uint8_t mode) { void set_big_LED_g(uint8_t mode) { switch(mode) { case LED_ON: - setPinOutput(BIG_LED_G_PIN); - writePin(BIG_LED_G_PIN, GPIO_STATE_HIGH); + gpio_set_pin_output(BIG_LED_G_PIN); + gpio_write_pin(BIG_LED_G_PIN, GPIO_STATE_HIGH); break; case LED_OFF: - setPinOutput(BIG_LED_G_PIN); - writePin(BIG_LED_G_PIN, GPIO_STATE_LOW); + gpio_set_pin_output(BIG_LED_G_PIN); + gpio_write_pin(BIG_LED_G_PIN, GPIO_STATE_LOW); break; default: @@ -58,13 +58,13 @@ void set_big_LED_g(uint8_t mode) { void set_big_LED_b(uint8_t mode) { switch(mode) { case LED_ON: - setPinOutput(BIG_LED_B_PIN); - writePin(BIG_LED_B_PIN, GPIO_STATE_HIGH); + gpio_set_pin_output(BIG_LED_B_PIN); + gpio_write_pin(BIG_LED_B_PIN, GPIO_STATE_HIGH); break; case LED_OFF: - setPinOutput(BIG_LED_B_PIN); - writePin(BIG_LED_B_PIN, GPIO_STATE_LOW); + gpio_set_pin_output(BIG_LED_B_PIN); + gpio_write_pin(BIG_LED_B_PIN, GPIO_STATE_LOW); break; default: diff --git a/keyboards/nullbitsco/nibble/matrix.c b/keyboards/nullbitsco/nibble/matrix.c index 6508b704e9..7ea5a6c470 100644 --- a/keyboards/nullbitsco/nibble/matrix.c +++ b/keyboards/nullbitsco/nibble/matrix.c @@ -27,17 +27,17 @@ static const uint8_t col_pins[MATRIX_MUX_COLS] = MATRIX_COL_MUX_PINS; static void init_pins(void) { // Set cols to outputs, low for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) { - setPinOutput(col_pins[pin]); + gpio_set_pin_output(col_pins[pin]); } // Unselect cols for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { - writePinLow(col_pins[bit]); + gpio_write_pin_low(col_pins[bit]); } // Set rows to input, pullup for (uint8_t pin = 0; pin < MATRIX_ROWS; pin++) { - setPinInputHigh(row_pins[pin]); + gpio_set_pin_input_high(row_pins[pin]); } } @@ -45,7 +45,7 @@ static void select_col(uint8_t col) { for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { uint8_t state = (col & (0b1 << bit)) >> bit; - writePin(col_pins[bit], state); + gpio_write_pin(col_pins[bit], state); } } @@ -60,7 +60,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/scramble/v1/v1.c b/keyboards/nullbitsco/scramble/v1/v1.c index 4b5e8e3e67..3a85dce192 100644 --- a/keyboards/nullbitsco/scramble/v1/v1.c +++ b/keyboards/nullbitsco/scramble/v1/v1.c @@ -6,17 +6,17 @@ void set_scramble_LED(uint8_t mode) { switch(mode) { case LED_ON: - setPinOutput(PIN_LED); - writePin(PIN_LED, GPIO_STATE_HIGH); + gpio_set_pin_output(PIN_LED); + gpio_write_pin(PIN_LED, GPIO_STATE_HIGH); break; case LED_DIM: - setPinInput(PIN_LED); + gpio_set_pin_input(PIN_LED); break; case LED_OFF: - setPinOutput(PIN_LED); - writePin(PIN_LED, GPIO_STATE_LOW); + gpio_set_pin_output(PIN_LED); + gpio_write_pin(PIN_LED, GPIO_STATE_LOW); break; default: diff --git a/keyboards/nullbitsco/snap/matrix.c b/keyboards/nullbitsco/snap/matrix.c index 3cd3f5c37e..64b451641d 100644 --- a/keyboards/nullbitsco/snap/matrix.c +++ b/keyboards/nullbitsco/snap/matrix.c @@ -37,23 +37,23 @@ static uint8_t* col_pins = col_pins_left; static void init_pins(void) { // Set cols to outputs, low for (uint8_t pin = 0; pin < MATRIX_MUX_COLS; pin++) { - setPinOutput(col_pins[pin]); + gpio_set_pin_output(col_pins[pin]); } // Unselect cols for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { - writePinLow(col_pins[bit]); + gpio_write_pin_low(col_pins[bit]); } // Set rows to input, pullup for (uint8_t pin = 0; pin < ROWS_PER_HAND; pin++) { - setPinInputHigh(row_pins[pin]); + gpio_set_pin_input_high(row_pins[pin]); } // Set extended pin (only on right side) if (!isLeftHand) { // Set extended pin to input, pullup - setPinInputHigh(MATRIX_EXT_PIN_RIGHT); + gpio_set_pin_input_high(MATRIX_EXT_PIN_RIGHT); } } @@ -61,7 +61,7 @@ static void select_col(uint8_t col) { // Drive demux with correct column address for (uint8_t bit = 0; bit < MATRIX_MUX_COLS; bit++) { uint8_t state = (col & (0b1 << bit)) >> bit; - writePin(col_pins[bit], !state); + gpio_write_pin(col_pins[bit], !state); } } @@ -71,7 +71,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); @@ -82,7 +82,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); |