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/ryanskidmore | |
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/ryanskidmore')
-rw-r--r-- | keyboards/ryanskidmore/rskeys100/matrix.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/keyboards/ryanskidmore/rskeys100/matrix.c b/keyboards/ryanskidmore/rskeys100/matrix.c index 2ab9eafd7f..53ad18ee48 100644 --- a/keyboards/ryanskidmore/rskeys100/matrix.c +++ b/keyboards/ryanskidmore/rskeys100/matrix.c @@ -30,16 +30,16 @@ static void shift_out_single(uint8_t value); static void shift_out(uint32_t value); void matrix_init_custom(void) { - setPinInput(ROW_A); - setPinInput(ROW_B); - setPinInput(ROW_C); - setPinInput(ROW_D); - setPinInput(ROW_E); - setPinInput(ROW_F); - - setPinOutput(SHR_DATA); - setPinOutput(SHR_LATCH); - setPinOutput(SHR_CLOCK); + gpio_set_pin_input(ROW_A); + gpio_set_pin_input(ROW_B); + gpio_set_pin_input(ROW_C); + gpio_set_pin_input(ROW_D); + gpio_set_pin_input(ROW_E); + gpio_set_pin_input(ROW_F); + + gpio_set_pin_output(SHR_DATA); + gpio_set_pin_output(SHR_LATCH); + gpio_set_pin_output(SHR_CLOCK); } bool matrix_scan_custom(matrix_row_t current_matrix[]) { @@ -63,12 +63,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) { @@ -76,7 +76,7 @@ static void select_col(uint8_t col) { } static void shift_out(uint32_t value) { - writePinLow(SHR_LATCH); + gpio_write_pin_low(SHR_LATCH); uint8_t first_byte = (value >> 16) & 0xFF; uint8_t second_byte = (value >> 8) & 0xFF; uint8_t third_byte = (uint8_t)(value & 0xFF); @@ -84,7 +84,7 @@ static void shift_out(uint32_t value) { shift_out_single(first_byte); shift_out_single(second_byte); shift_out_single(third_byte); - writePinHigh(SHR_LATCH); + gpio_write_pin_high(SHR_LATCH); /* We delay here to prevent multiple consecutive keys being triggered with a single switch press */ _delay_us(10); } @@ -92,9 +92,9 @@ static void shift_out(uint32_t value) { static void shift_out_single(uint8_t value) { for (uint8_t i = 0; i < 8; i++) { if (value & 0b10000000) { - writePinHigh(SHR_DATA); + gpio_write_pin_high(SHR_DATA); } else { - writePinLow(SHR_DATA); + gpio_write_pin_low(SHR_DATA); } shift_pulse(); @@ -103,6 +103,6 @@ static void shift_out_single(uint8_t value) { } static inline void shift_pulse(void) { - writePinHigh(SHR_CLOCK); - writePinLow(SHR_CLOCK); + gpio_write_pin_high(SHR_CLOCK); + gpio_write_pin_low(SHR_CLOCK); }
\ No newline at end of file |