diff options
author | Ryan <fauxpark@gmail.com> | 2024-02-18 17:08:27 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 17:08:27 +1100 |
commit | 2d1aed78a67b3d2b002cc739ef087963b05b76b8 (patch) | |
tree | ea681d02e547332cffa6b7aec6c16ef37ad70ee3 /platforms/avr | |
parent | 6810aaf0130113e267e20fb506d874cc858f5f67 (diff) |
Update GPIO macro usages in core (#23093)
Diffstat (limited to 'platforms/avr')
-rw-r--r-- | platforms/avr/drivers/audio_pwm_hardware.c | 4 | ||||
-rw-r--r-- | platforms/avr/drivers/backlight_pwm.c | 6 | ||||
-rw-r--r-- | platforms/avr/drivers/ps2/ps2_io.c | 20 | ||||
-rw-r--r-- | platforms/avr/drivers/serial.c | 10 | ||||
-rw-r--r-- | platforms/avr/drivers/spi_master.c | 16 |
5 files changed, 28 insertions, 28 deletions
diff --git a/platforms/avr/drivers/audio_pwm_hardware.c b/platforms/avr/drivers/audio_pwm_hardware.c index 6799cf2fdd..d484fba00f 100644 --- a/platforms/avr/drivers/audio_pwm_hardware.c +++ b/platforms/avr/drivers/audio_pwm_hardware.c @@ -216,12 +216,12 @@ void channel_2_stop(void) { void audio_driver_initialize(void) { #ifdef AUDIO1_PIN_SET channel_1_stop(); - setPinOutput(AUDIO1_PIN); + gpio_set_pin_output(AUDIO1_PIN); #endif #ifdef AUDIO2_PIN_SET channel_2_stop(); - setPinOutput(AUDIO2_PIN); + gpio_set_pin_output(AUDIO2_PIN); #endif // TCCR3A / TCCR3B: Timer/Counter #3 Control Registers TCCR3A/TCCR3B, TCCR1A/TCCR1B diff --git a/platforms/avr/drivers/backlight_pwm.c b/platforms/avr/drivers/backlight_pwm.c index 74d25753a4..f6ab9391e2 100644 --- a/platforms/avr/drivers/backlight_pwm.c +++ b/platforms/avr/drivers/backlight_pwm.c @@ -291,11 +291,11 @@ ISR(TIMERx_OVF_vect) { #endif // BACKLIGHT_BREATHING void backlight_init_ports(void) { - setPinOutput(BACKLIGHT_PIN); + gpio_set_pin_output(BACKLIGHT_PIN); #if BACKLIGHT_ON_STATE == 1 - writePinLow(BACKLIGHT_PIN); + gpio_write_pin_low(BACKLIGHT_PIN); #else - writePinHigh(BACKLIGHT_PIN); + gpio_write_pin_high(BACKLIGHT_PIN); #endif // I could write a wall of text here to explain... but TL;DW diff --git a/platforms/avr/drivers/ps2/ps2_io.c b/platforms/avr/drivers/ps2/ps2_io.c index b75a1ab0be..fb87474372 100644 --- a/platforms/avr/drivers/ps2/ps2_io.c +++ b/platforms/avr/drivers/ps2/ps2_io.c @@ -19,18 +19,18 @@ void clock_init(void) {} void clock_lo(void) { // Transition from input with pull-up to output low via Hi-Z instead of output high - writePinLow(PS2_CLOCK_PIN); - setPinOutput(PS2_CLOCK_PIN); + gpio_write_pin_low(PS2_CLOCK_PIN); + gpio_set_pin_output(PS2_CLOCK_PIN); } void clock_hi(void) { - setPinInputHigh(PS2_CLOCK_PIN); + gpio_set_pin_input_high(PS2_CLOCK_PIN); } bool clock_in(void) { - setPinInputHigh(PS2_CLOCK_PIN); + gpio_set_pin_input_high(PS2_CLOCK_PIN); wait_us(1); - return readPin(PS2_CLOCK_PIN); + return gpio_read_pin(PS2_CLOCK_PIN); } /* @@ -40,16 +40,16 @@ void data_init(void) {} void data_lo(void) { // Transition from input with pull-up to output low via Hi-Z instead of output high - writePinLow(PS2_DATA_PIN); - setPinOutput(PS2_DATA_PIN); + gpio_write_pin_low(PS2_DATA_PIN); + gpio_set_pin_output(PS2_DATA_PIN); } void data_hi(void) { - setPinInputHigh(PS2_DATA_PIN); + gpio_set_pin_input_high(PS2_DATA_PIN); } bool data_in(void) { - setPinInputHigh(PS2_DATA_PIN); + gpio_set_pin_input_high(PS2_DATA_PIN); wait_us(1); - return readPin(PS2_DATA_PIN); + return gpio_read_pin(PS2_DATA_PIN); } diff --git a/platforms/avr/drivers/serial.c b/platforms/avr/drivers/serial.c index 730d9b7a01..b529f9b45e 100644 --- a/platforms/avr/drivers/serial.c +++ b/platforms/avr/drivers/serial.c @@ -239,28 +239,28 @@ inline static void serial_delay_half2(void) { inline static void serial_output(void) ALWAYS_INLINE; inline static void serial_output(void) { - setPinOutput(SOFT_SERIAL_PIN); + gpio_set_pin_output(SOFT_SERIAL_PIN); } // make the serial pin an input with pull-up resistor inline static void serial_input_with_pullup(void) ALWAYS_INLINE; inline static void serial_input_with_pullup(void) { - setPinInputHigh(SOFT_SERIAL_PIN); + gpio_set_pin_input_high(SOFT_SERIAL_PIN); } inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { - return !!readPin(SOFT_SERIAL_PIN); + return !!gpio_read_pin(SOFT_SERIAL_PIN); } inline static void serial_low(void) ALWAYS_INLINE; inline static void serial_low(void) { - writePinLow(SOFT_SERIAL_PIN); + gpio_write_pin_low(SOFT_SERIAL_PIN); } inline static void serial_high(void) ALWAYS_INLINE; inline static void serial_high(void) { - writePinHigh(SOFT_SERIAL_PIN); + gpio_write_pin_high(SOFT_SERIAL_PIN); } void soft_serial_initiator_init(void) { diff --git a/platforms/avr/drivers/spi_master.c b/platforms/avr/drivers/spi_master.c index ae9df03c02..74b847c71a 100644 --- a/platforms/avr/drivers/spi_master.c +++ b/platforms/avr/drivers/spi_master.c @@ -41,10 +41,10 @@ static uint8_t currentSlaveConfig = 0; static bool currentSlave2X = false; void spi_init(void) { - writePinHigh(SPI_SS_PIN); - setPinOutput(SPI_SCK_PIN); - setPinOutput(SPI_MOSI_PIN); - setPinInput(SPI_MISO_PIN); + gpio_write_pin_high(SPI_SS_PIN); + gpio_set_pin_output(SPI_SCK_PIN); + gpio_set_pin_output(SPI_MOSI_PIN); + gpio_set_pin_input(SPI_MISO_PIN); SPCR = (_BV(SPE) | _BV(MSTR)); } @@ -105,8 +105,8 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) { SPSR |= _BV(SPI2X); } currentSlavePin = slavePin; - setPinOutput(currentSlavePin); - writePinLow(currentSlavePin); + gpio_set_pin_output(currentSlavePin); + gpio_write_pin_low(currentSlavePin); return true; } @@ -169,8 +169,8 @@ spi_status_t spi_receive(uint8_t *data, uint16_t length) { void spi_stop(void) { if (currentSlavePin != NO_PIN) { - setPinOutput(currentSlavePin); - writePinHigh(currentSlavePin); + gpio_set_pin_output(currentSlavePin); + gpio_write_pin_high(currentSlavePin); currentSlavePin = NO_PIN; SPSR &= ~(_BV(SPI2X)); SPCR &= ~(currentSlaveConfig); |