summaryrefslogtreecommitdiffstats
path: root/keyboards/sixshooter/sixshooter.h
blob: d27b1e419ca7306a46e0066862c2e6af7c6f9ba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef SIXSHOOTER_H
#define SIXSHOOTER_H

#include "quantum.h"

#define LAYOUT( \
	K00, K01, K02, \
	K03, K04, K05 \
) { \
	{ K00, K01, K02, K03, K04, K05 }, \
}


/*
 * Define keyboard specific keycodes for controlling on/off for all LEDs as they
 * are all on different pins with this PCB, rather than a single backlight pin
 */
enum keyboard_keycode {
  SS_LON = SAFE_RANGE,
  SS_LOFF,
  SAFE_RANGE_KB
};

inline void sixshooter_led_0_on(void)    { DDRB |=  (1<<6); PORTB |=  (1<<6); }
inline void sixshooter_led_1_on(void)    { DDRC |=  (1<<7); PORTC |=  (1<<7); }
inline void sixshooter_led_2_on(void)    { DDRD |=  (1<<0); PORTD |=  (1<<0); }
inline void sixshooter_led_3_on(void)    { DDRB |=  (1<<5); PORTB |=  (1<<5); }
inline void sixshooter_led_4_on(void)    { DDRD |=  (1<<7); PORTD |=  (1<<7); }
inline void sixshooter_led_5_on(void)    { DDRB |=  (1<<7); PORTB |=  (1<<7); }

inline void sixshooter_led_0_off(void)   { DDRB &= ~(1<<6); PORTB &= ~(1<<6); }
inline void sixshooter_led_1_off(void)   { DDRC &= ~(1<<7); PORTC &= ~(1<<7); }
inline void sixshooter_led_2_off(void)   { DDRD &= ~(1<<0); PORTD &= ~(1<<0); }
inline void sixshooter_led_3_off(void)   { DDRB &= ~(1<<5); PORTB &= ~(1<<5); }
inline void sixshooter_led_4_off(void)   { DDRD &= ~(1<<7); PORTD &= ~(1<<7); }
inline void sixshooter_led_5_off(void)   { DDRB &= ~(1<<7); PORTB &= ~(1<<7); }

inline void sixshooter_led_all_on(void) {
  sixshooter_led_0_on();
  sixshooter_led_1_on();
  sixshooter_led_2_on();
  sixshooter_led_3_on();
  sixshooter_led_4_on();
  sixshooter_led_5_on();
}
inline void sixshooter_led_all_off(void) {
  sixshooter_led_0_off();
  sixshooter_led_1_off();
  sixshooter_led_2_off();
  sixshooter_led_3_off();
  sixshooter_led_4_off();
  sixshooter_led_5_off();
}

#endif