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/durgod | |
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/durgod')
-rw-r--r-- | keyboards/durgod/dgk6x/dgk6x.c | 20 | ||||
-rw-r--r-- | keyboards/durgod/k310/k310.c | 36 | ||||
-rw-r--r-- | keyboards/durgod/k320/k320.c | 36 |
3 files changed, 46 insertions, 46 deletions
diff --git a/keyboards/durgod/dgk6x/dgk6x.c b/keyboards/durgod/dgk6x/dgk6x.c index b7f1da778d..4db54859de 100644 --- a/keyboards/durgod/dgk6x/dgk6x.c +++ b/keyboards/durgod/dgk6x/dgk6x.c @@ -18,22 +18,22 @@ /* Private Functions */ void off_all_leds(void) { - writePinHigh(LED_CAPS_LOCK_PIN); - writePinHigh(LED_WIN_LOCK_PIN); - writePinHigh(LED_MR_LOCK_PIN); + gpio_write_pin_high(LED_CAPS_LOCK_PIN); + gpio_write_pin_high(LED_WIN_LOCK_PIN); + gpio_write_pin_high(LED_MR_LOCK_PIN); } void on_all_leds(void) { - writePinLow(LED_CAPS_LOCK_PIN); - writePinLow(LED_WIN_LOCK_PIN); - writePinLow(LED_MR_LOCK_PIN); + gpio_write_pin_low(LED_CAPS_LOCK_PIN); + gpio_write_pin_low(LED_WIN_LOCK_PIN); + gpio_write_pin_low(LED_MR_LOCK_PIN); } /* WinLock and MR LEDs are non-standard. Need to override led init */ void led_init_ports(void) { - setPinOutput(LED_CAPS_LOCK_PIN); - setPinOutput(LED_WIN_LOCK_PIN); - setPinOutput(LED_MR_LOCK_PIN); + gpio_set_pin_output(LED_CAPS_LOCK_PIN); + gpio_set_pin_output(LED_WIN_LOCK_PIN); + gpio_set_pin_output(LED_MR_LOCK_PIN); off_all_leds(); } @@ -44,7 +44,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { case GU_TOGG: if (record->event.pressed) { // Toggle LED on key press - togglePin(LED_WIN_LOCK_PIN); + gpio_toggle_pin(LED_WIN_LOCK_PIN); } break; } diff --git a/keyboards/durgod/k310/k310.c b/keyboards/durgod/k310/k310.c index a88100be20..7879b13f4e 100644 --- a/keyboards/durgod/k310/k310.c +++ b/keyboards/durgod/k310/k310.c @@ -22,33 +22,33 @@ /* Private Functions */ void off_all_leds(void) { #ifdef LED_NUM_LOCK_PIN - writePinHigh(LED_NUM_LOCK_PIN); + gpio_write_pin_high(LED_NUM_LOCK_PIN); #endif - writePinHigh(LED_CAPS_LOCK_PIN); - writePinHigh(LED_SCROLL_LOCK_PIN); - writePinHigh(LED_WIN_LOCK_PIN); - writePinHigh(LED_MR_LOCK_PIN); + gpio_write_pin_high(LED_CAPS_LOCK_PIN); + gpio_write_pin_high(LED_SCROLL_LOCK_PIN); + gpio_write_pin_high(LED_WIN_LOCK_PIN); + gpio_write_pin_high(LED_MR_LOCK_PIN); } void on_all_leds(void) { #ifdef LED_NUM_LOCK_PIN - writePinLow(LED_NUM_LOCK_PIN); + gpio_write_pin_low(LED_NUM_LOCK_PIN); #endif - writePinLow(LED_CAPS_LOCK_PIN); - writePinLow(LED_SCROLL_LOCK_PIN); - writePinLow(LED_WIN_LOCK_PIN); - writePinLow(LED_MR_LOCK_PIN); + gpio_write_pin_low(LED_CAPS_LOCK_PIN); + gpio_write_pin_low(LED_SCROLL_LOCK_PIN); + gpio_write_pin_low(LED_WIN_LOCK_PIN); + gpio_write_pin_low(LED_MR_LOCK_PIN); } /* WinLock and MR LEDs are non-standard. Need to override led init */ void led_init_ports(void) { #ifdef LED_NUM_LOCK_PIN - setPinOutput(LED_NUM_LOCK_PIN); + gpio_set_pin_output(LED_NUM_LOCK_PIN); #endif - setPinOutput(LED_CAPS_LOCK_PIN); - setPinOutput(LED_SCROLL_LOCK_PIN); - setPinOutput(LED_WIN_LOCK_PIN); - setPinOutput(LED_MR_LOCK_PIN); + gpio_set_pin_output(LED_CAPS_LOCK_PIN); + gpio_set_pin_output(LED_SCROLL_LOCK_PIN); + gpio_set_pin_output(LED_WIN_LOCK_PIN); + gpio_set_pin_output(LED_MR_LOCK_PIN); off_all_leds(); } @@ -58,7 +58,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { case GU_TOGG: if (record->event.pressed) { // Toggle LED on key press - togglePin(LED_WIN_LOCK_PIN); + gpio_toggle_pin(LED_WIN_LOCK_PIN); } break; } @@ -75,7 +75,7 @@ static void hardware_reset_cb(void *arg) { #endif void keyboard_pre_init_kb(void) { - setPinInputHigh(HARDWARE_RESET_PIN); + gpio_set_pin_input_high(HARDWARE_RESET_PIN); #ifndef HW_RESET_PIN_DISABLED /* Jump to bootloader when the hardware reset button is pressed */ @@ -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 c1b9701d7b..0a544fe318 100644 --- a/keyboards/durgod/k320/k320.c +++ b/keyboards/durgod/k320/k320.c @@ -22,33 +22,33 @@ /* Private Functions */ void off_all_leds(void) { #ifdef LED_NUM_LOCK_PIN - writePinHigh(LED_NUM_LOCK_PIN); + gpio_write_pin_high(LED_NUM_LOCK_PIN); #endif - writePinHigh(LED_CAPS_LOCK_PIN); - writePinHigh(LED_SCROLL_LOCK_PIN); - writePinHigh(LED_WIN_LOCK_PIN); - writePinHigh(LED_MR_LOCK_PIN); + gpio_write_pin_high(LED_CAPS_LOCK_PIN); + gpio_write_pin_high(LED_SCROLL_LOCK_PIN); + gpio_write_pin_high(LED_WIN_LOCK_PIN); + gpio_write_pin_high(LED_MR_LOCK_PIN); } void on_all_leds(void) { #ifdef LED_NUM_LOCK_PIN - writePinLow(LED_NUM_LOCK_PIN); + gpio_write_pin_low(LED_NUM_LOCK_PIN); #endif - writePinLow(LED_CAPS_LOCK_PIN); - writePinLow(LED_SCROLL_LOCK_PIN); - writePinLow(LED_WIN_LOCK_PIN); - writePinLow(LED_MR_LOCK_PIN); + gpio_write_pin_low(LED_CAPS_LOCK_PIN); + gpio_write_pin_low(LED_SCROLL_LOCK_PIN); + gpio_write_pin_low(LED_WIN_LOCK_PIN); + gpio_write_pin_low(LED_MR_LOCK_PIN); } /* WinLock and MR LEDs are non-standard. Need to override led init */ void led_init_ports(void) { #ifdef LED_NUM_LOCK_PIN - setPinOutput(LED_NUM_LOCK_PIN); + gpio_set_pin_output(LED_NUM_LOCK_PIN); #endif - setPinOutput(LED_CAPS_LOCK_PIN); - setPinOutput(LED_SCROLL_LOCK_PIN); - setPinOutput(LED_WIN_LOCK_PIN); - setPinOutput(LED_MR_LOCK_PIN); + gpio_set_pin_output(LED_CAPS_LOCK_PIN); + gpio_set_pin_output(LED_SCROLL_LOCK_PIN); + gpio_set_pin_output(LED_WIN_LOCK_PIN); + gpio_set_pin_output(LED_MR_LOCK_PIN); off_all_leds(); } @@ -58,7 +58,7 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { case GU_TOGG: if (record->event.pressed) { // Toggle LED on key press - togglePin(LED_WIN_LOCK_PIN); + gpio_toggle_pin(LED_WIN_LOCK_PIN); } break; } @@ -75,7 +75,7 @@ static void hardware_reset_cb(void *arg) { #endif void keyboard_pre_init_kb(void) { - setPinInputHigh(HARDWARE_RESET_PIN); + gpio_set_pin_input_high(HARDWARE_RESET_PIN); #ifndef HW_RESET_PIN_DISABLED /* Jump to bootloader when the hardware reset button is pressed */ @@ -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 |