1
0
Fork 0

Convert some AVR GPIO operations to macros (#23424)

This commit is contained in:
Ryan 2024-05-02 19:48:49 +10:00 committed by GitHub
parent 7220715dd1
commit 61c7c1f74c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
71 changed files with 877 additions and 840 deletions

View file

@ -3,6 +3,9 @@
#include "quantum.h"
#include "led.h"
#define ORG60_CAPS_LOCK_LED_PIN B2
#define ORG60_BACKLIGHT_PIN F5
/* Org60 LEDs
* GPIO pads
* 0 F7 not connected
@ -12,8 +15,18 @@
* B2 Capslock LED
* B0 not connected
*/
inline void org60_caps_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); }
inline void org60_bl_led_on(void) { DDRF |= (1<<5); PORTF &= ~(1<<5); }
inline void org60_caps_led_on(void) {
gpio_set_pin_output(ORG60_CAPS_LOCK_LED_PIN);
gpio_write_pin_low(ORG60_CAPS_LOCK_LED_PIN);
}
inline void org60_bl_led_on(void) {
gpio_set_pin_output(ORG60_BACKLIGHT_PIN);
gpio_write_pin_low(ORG60_BACKLIGHT_PIN);
}
inline void org60_caps_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); }
inline void org60_bl_led_off(void) { DDRF &= ~(1<<5); PORTF &= ~(1<<5); }
inline void org60_caps_led_off(void) {
gpio_set_pin_input(ORG60_CAPS_LOCK_LED_PIN);
}
inline void org60_bl_led_off(void) {
gpio_set_pin_input(ORG60_BACKLIGHT_PIN);
}