rev3.c (788B)
1 #include "quantum.h" 2 #include "print.h" 3 4 void backlight_init_ports(void) { 5 print("init_backlight_pin()\n"); 6 // Set our LED pins as output 7 gpio_set_pin_output(D6); // Esc 8 gpio_set_pin_output(B7); // Page Up 9 gpio_set_pin_output(D4); // Arrows 10 11 // Set our LED pins low 12 gpio_write_pin_low(D6); // Esc 13 gpio_write_pin_low(B7); // Page Up 14 gpio_write_pin_low(D4); // Arrows 15 } 16 17 void backlight_set(uint8_t level) { 18 if ( level == 0 ) { 19 // Turn off light 20 gpio_write_pin_high(D6); // Esc 21 gpio_write_pin_high(B7); // Page Up 22 gpio_write_pin_high(D4); // Arrows 23 } else { 24 // Turn on light 25 gpio_write_pin_low(D6); // Esc 26 gpio_write_pin_low(B7); // Page Up 27 gpio_write_pin_low(D4); // Arrows 28 } 29 }