sixshooter.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); }
  11. inline void sixshooter_led_1_on(void) { DDRC |= (1<<7); PORTC |= (1<<7); }
  12. inline void sixshooter_led_2_on(void) { DDRD |= (1<<0); PORTD |= (1<<0); }
  13. inline void sixshooter_led_3_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); }
  14. inline void sixshooter_led_4_on(void) { DDRD |= (1<<7); PORTD |= (1<<7); }
  15. inline void sixshooter_led_5_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); }
  16. inline void sixshooter_led_0_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); }
  17. inline void sixshooter_led_1_off(void) { DDRC &= ~(1<<7); PORTC &= ~(1<<7); }
  18. inline void sixshooter_led_2_off(void) { DDRD &= ~(1<<0); PORTD &= ~(1<<0); }
  19. inline void sixshooter_led_3_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); }
  20. inline void sixshooter_led_4_off(void) { DDRD &= ~(1<<7); PORTD &= ~(1<<7); }
  21. inline void sixshooter_led_5_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); }
  22. inline void sixshooter_led_all_on(void) {
  23. sixshooter_led_0_on();
  24. sixshooter_led_1_on();
  25. sixshooter_led_2_on();
  26. sixshooter_led_3_on();
  27. sixshooter_led_4_on();
  28. sixshooter_led_5_on();
  29. }
  30. inline void sixshooter_led_all_off(void) {
  31. sixshooter_led_0_off();
  32. sixshooter_led_1_off();
  33. sixshooter_led_2_off();
  34. sixshooter_led_3_off();
  35. sixshooter_led_4_off();
  36. sixshooter_led_5_off();
  37. }
  38. #endif