From b8646bc40bd616167da150f6da4eda372f7de23d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 17 Feb 2024 00:18:26 +1100 Subject: Update naming convention for GPIO control macros (#23085) --- platforms/chibios/gpio.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'platforms/chibios/gpio.h') diff --git a/platforms/chibios/gpio.h b/platforms/chibios/gpio.h index 80551abac5..a8d6554f29 100644 --- a/platforms/chibios/gpio.h +++ b/platforms/chibios/gpio.h @@ -22,24 +22,24 @@ typedef ioline_t pin_t; /* Operation of GPIO by pin. */ -#define setPinInput(pin) palSetLineMode((pin), PAL_MODE_INPUT) -#define setPinInputHigh(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLUP) -#define setPinInputLow(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLDOWN) -#define setPinOutputPushPull(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_PUSHPULL) -#define setPinOutputOpenDrain(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_OPENDRAIN) -#define setPinOutput(pin) setPinOutputPushPull(pin) +#define gpio_set_pin_input(pin) palSetLineMode((pin), PAL_MODE_INPUT) +#define gpio_set_pin_input_high(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLUP) +#define gpio_set_pin_input_low(pin) palSetLineMode((pin), PAL_MODE_INPUT_PULLDOWN) +#define gpio_set_pin_output_push_pull(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_PUSHPULL) +#define gpio_set_pin_output_open_drain(pin) palSetLineMode((pin), PAL_MODE_OUTPUT_OPENDRAIN) +#define gpio_set_pin_output(pin) gpio_set_pin_output_push_pull(pin) -#define writePinHigh(pin) palSetLine(pin) -#define writePinLow(pin) palClearLine(pin) -#define writePin(pin, level) \ - do { \ - if (level) { \ - writePinHigh(pin); \ - } else { \ - writePinLow(pin); \ - } \ +#define gpio_write_pin_high(pin) palSetLine(pin) +#define gpio_write_pin_low(pin) palClearLine(pin) +#define gpio_write_pin(pin, level) \ + do { \ + if (level) { \ + gpio_write_pin_high(pin); \ + } else { \ + gpio_write_pin_low(pin); \ + } \ } while (0) -#define readPin(pin) palReadLine(pin) +#define gpio_read_pin(pin) palReadLine(pin) -#define togglePin(pin) palToggleLine(pin) +#define gpio_toggle_pin(pin) palToggleLine(pin) -- cgit v1.2.3