aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/sixshooter/sixshooter.h
diff options
context:
space:
mode:
authorNicholas Shaff <nick@shadedream.com>2018-08-11 15:23:11 -0500
committerDrashna Jaelre <drashna@live.com>2018-08-11 13:23:11 -0700
commit317c624761741f71856f20ab55916e637183edb4 (patch)
treee3de6a0815beeeb0faf9fa8748a607fc841576b2 /keyboards/sixshooter/sixshooter.h
parente5f201edb426b01537abd659e1ca317260d87654 (diff)
downloadfirmware-317c624761741f71856f20ab55916e637183edb4.tar.gz
firmware-317c624761741f71856f20ab55916e637183edb4.tar.bz2
firmware-317c624761741f71856f20ab55916e637183edb4.zip
Keyboard: Six Shooter Keyboard (#3598)
* Created base sixshooter configuration * Added SixShooter basic LED on/off support. * Updated LED identifier numbers to align with layout identifiers (and IDs on PCB). * Minor sixshooter documentation cleanup. * Added sixshooter info.json file. * Moved sixshooter custom keycodes out of keymaps and into base keyboard files, small documentation tweaks. * Removed unnecessary boot section size definition. * Removing CONFIG_H if/define and replacing with #pragma once.
Diffstat (limited to 'keyboards/sixshooter/sixshooter.h')
-rw-r--r--keyboards/sixshooter/sixshooter.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/keyboards/sixshooter/sixshooter.h b/keyboards/sixshooter/sixshooter.h
new file mode 100644
index 000000000..d27b1e419
--- /dev/null
+++ b/keyboards/sixshooter/sixshooter.h
@@ -0,0 +1,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