sixshooter.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef SIXSHOOTER_H
  2. #define SIXSHOOTER_H
  3. #include "quantum.h"
  4. #define LAYOUT( \
  5. K00, K01, K02, \
  6. K03, K04, K05 \
  7. ) { \
  8. { K00, K01, K02, K03, K04, K05 }, \
  9. }
  10. /*
  11. * Define keyboard specific keycodes for controlling on/off for all LEDs as they
  12. * are all on different pins with this PCB, rather than a single backlight pin
  13. */
  14. enum keyboard_keycode {
  15. SS_LON = SAFE_RANGE,
  16. SS_LOFF,
  17. SAFE_RANGE_KB
  18. };
  19. inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); }
  20. inline void sixshooter_led_1_on(void) { DDRC |= (1<<7); PORTC |= (1<<7); }
  21. inline void sixshooter_led_2_on(void) { DDRD |= (1<<0); PORTD |= (1<<0); }
  22. inline void sixshooter_led_3_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); }
  23. inline void sixshooter_led_4_on(void) { DDRD |= (1<<7); PORTD |= (1<<7); }
  24. inline void sixshooter_led_5_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); }
  25. inline void sixshooter_led_0_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); }
  26. inline void sixshooter_led_1_off(void) { DDRC &= ~(1<<7); PORTC &= ~(1<<7); }
  27. inline void sixshooter_led_2_off(void) { DDRD &= ~(1<<0); PORTD &= ~(1<<0); }
  28. inline void sixshooter_led_3_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); }
  29. inline void sixshooter_led_4_off(void) { DDRD &= ~(1<<7); PORTD &= ~(1<<7); }
  30. inline void sixshooter_led_5_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); }
  31. inline void sixshooter_led_all_on(void) {
  32. sixshooter_led_0_on();
  33. sixshooter_led_1_on();
  34. sixshooter_led_2_on();
  35. sixshooter_led_3_on();
  36. sixshooter_led_4_on();
  37. sixshooter_led_5_on();
  38. }
  39. inline void sixshooter_led_all_off(void) {
  40. sixshooter_led_0_off();
  41. sixshooter_led_1_off();
  42. sixshooter_led_2_off();
  43. sixshooter_led_3_off();
  44. sixshooter_led_4_off();
  45. sixshooter_led_5_off();
  46. }
  47. #endif