2023-05-01 05:33:10 +02:00
|
|
|
#include "quantum.h"
|
2017-09-07 00:27:29 +02:00
|
|
|
#include "print.h"
|
|
|
|
|
|
|
|
void backlight_init_ports(void) {
|
|
|
|
print("init_backlight_pin()\n");
|
|
|
|
// Set our LED pins as output
|
2024-05-02 11:48:49 +02:00
|
|
|
gpio_set_pin_output(D6); // Esc
|
|
|
|
gpio_set_pin_output(B7); // Page Up
|
|
|
|
gpio_set_pin_output(D4); // Arrows
|
2017-09-07 00:27:29 +02:00
|
|
|
|
|
|
|
// Set our LED pins low
|
2024-05-02 11:48:49 +02:00
|
|
|
gpio_write_pin_low(D6); // Esc
|
|
|
|
gpio_write_pin_low(B7); // Page Up
|
|
|
|
gpio_write_pin_low(D4); // Arrows
|
2017-09-07 00:27:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void backlight_set(uint8_t level) {
|
|
|
|
if ( level == 0 ) {
|
|
|
|
// Turn off light
|
2024-05-02 11:48:49 +02:00
|
|
|
gpio_write_pin_high(D6); // Esc
|
|
|
|
gpio_write_pin_high(B7); // Page Up
|
|
|
|
gpio_write_pin_high(D4); // Arrows
|
2017-09-07 00:27:29 +02:00
|
|
|
} else {
|
|
|
|
// Turn on light
|
2024-05-02 11:48:49 +02:00
|
|
|
gpio_write_pin_low(D6); // Esc
|
|
|
|
gpio_write_pin_low(B7); // Page Up
|
|
|
|
gpio_write_pin_low(D4); // Arrows
|
2017-09-07 00:27:29 +02:00
|
|
|
}
|
|
|
|
}
|