aboutsummaryrefslogtreecommitdiff
path: root/keyboards/opendeck
diff options
context:
space:
mode:
authorCmdr. Emily <68452184+cmdremily@users.noreply.github.com>2020-10-18 09:37:02 +0200
committerGitHub <noreply@github.com>2020-10-18 18:37:02 +1100
commitf952d4f7b779474918453b7ec3ccccdcfbd63b58 (patch)
treee8618b97336dc35994caba814885d61d68ce295b /keyboards/opendeck
parent8be058d55d2a50065294bac8e63020dbedae3f36 (diff)
downloadqmk_firmware-f952d4f7b779474918453b7ec3ccccdcfbd63b58.tar.gz
qmk_firmware-f952d4f7b779474918453b7ec3ccccdcfbd63b58.zip
Support OpenDeck 32 keyboard (#10305)
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/opendeck')
-rw-r--r--keyboards/opendeck/32/info.json46
-rw-r--r--keyboards/opendeck/32/keymaps/default/keymap.c37
-rw-r--r--keyboards/opendeck/32/keymaps/default/readme.md1
-rw-r--r--keyboards/opendeck/32/rev1/config.h53
-rw-r--r--keyboards/opendeck/32/rev1/rev1.c145
-rw-r--r--keyboards/opendeck/32/rev1/rev1.h45
-rw-r--r--keyboards/opendeck/32/rev1/rules.mk28
-rw-r--r--keyboards/opendeck/info.json4
-rw-r--r--keyboards/opendeck/readme.md19
9 files changed, 378 insertions, 0 deletions
diff --git a/keyboards/opendeck/32/info.json b/keyboards/opendeck/32/info.json
new file mode 100644
index 000000000..755b4ae23
--- /dev/null
+++ b/keyboards/opendeck/32/info.json
@@ -0,0 +1,46 @@
1{
2 "keyboard_name": "OpenDeck 32",
3 "width": 8,
4 "height": 4,
5 "layouts": {
6 "LAYOUT_ortho_4x8": {
7 "layout": [
8 { "x":0, "y":0 },
9 { "x":1, "y":0 },
10 { "x":2, "y":0 },
11 { "x":3, "y":0 },
12 { "x":4, "y":0 },
13 { "x":5, "y":0 },
14 { "x":6, "y":0 },
15 { "x":7, "y":0 },
16
17 { "x":0, "y":1 },
18 { "x":1, "y":1 },
19 { "x":2, "y":1 },
20 { "x":3, "y":1 },
21 { "x":4, "y":1 },
22 { "x":5, "y":1 },
23 { "x":6, "y":1 },
24 { "x":7, "y":1 },
25
26 { "x":0, "y":2 },
27 { "x":1, "y":2 },
28 { "x":2, "y":2 },
29 { "x":3, "y":2 },
30 { "x":4, "y":2 },
31 { "x":5, "y":2 },
32 { "x":6, "y":2 },
33 { "x":7, "y":2 },
34
35 { "x":0, "y":3 },
36 { "x":1, "y":3 },
37 { "x":2, "y":3 },
38 { "x":3, "y":3 },
39 { "x":4, "y":3 },
40 { "x":5, "y":3 },
41 { "x":6, "y":3 },
42 { "x":7, "y":3 }
43 ]
44 }
45 }
46}
diff --git a/keyboards/opendeck/32/keymaps/default/keymap.c b/keyboards/opendeck/32/keymaps/default/keymap.c
new file mode 100644
index 000000000..60cf2d5b7
--- /dev/null
+++ b/keyboards/opendeck/32/keymaps/default/keymap.c
@@ -0,0 +1,37 @@
1/* Copyright 2020 cmdremily
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18#define _BL 0
19
20// clang-format off
21const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
22[_BL] = LAYOUT_ortho_4x8(
23 LSFT(KC_F13), LSFT(KC_F17), LSFT(KC_F21), LCTL(KC_F13), LCTL(KC_F17), LCTL(KC_F21), LALT(KC_F13), LALT(KC_F17),
24 LSFT(KC_F14), LSFT(KC_F18), LSFT(KC_F22), LCTL(KC_F14), LCTL(KC_F18), LCTL(KC_F22), LALT(KC_F14), LALT(KC_F18),
25 LSFT(KC_F15), LSFT(KC_F19), LSFT(KC_F23), LCTL(KC_F15), LCTL(KC_F19), LCTL(KC_F23), LALT(KC_F15), LALT(KC_F19),
26 LSFT(KC_F16), LSFT(KC_F20), LSFT(KC_F24), LCTL(KC_F16), LCTL(KC_F20), LCTL(KC_F24), LALT(KC_F16), LALT(KC_F20)
27 )
28};
29// clang-format on
30
31void suspend_power_down_user(void) {
32 rgb_matrix_set_suspend_state(true);
33}
34
35void suspend_wakeup_init_user(void) {
36 rgb_matrix_set_suspend_state(false);
37}
diff --git a/keyboards/opendeck/32/keymaps/default/readme.md b/keyboards/opendeck/32/keymaps/default/readme.md
new file mode 100644
index 000000000..4ccf0b463
--- /dev/null
+++ b/keyboards/opendeck/32/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for OpenDeck32
diff --git a/keyboards/opendeck/32/rev1/config.h b/keyboards/opendeck/32/rev1/config.h
new file mode 100644
index 000000000..9f8ed7427
--- /dev/null
+++ b/keyboards/opendeck/32/rev1/config.h
@@ -0,0 +1,53 @@
1/* Copyright 2020 cmdremily
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "config_common.h"
19
20// USB Device descriptor parameter
21#define VENDOR_ID 0x4345
22#define PRODUCT_ID 0x2EC0
23#define DEVICE_VER 0x0001
24#define MANUFACTURER OpenDeck
25#define PRODUCT OpenDeck32
26
27// Key matrix (TtB, LtR)
28#define MATRIX_ROWS 4
29#define MATRIX_COLS 8
30#define MATRIX_COL_PINS \
31 { B4, D7, D6, D4, F7, F6, F5, F4 }
32#define MATRIX_ROW_PINS \
33 { C7, C6, B6, B5 }
34#define DIODE_DIRECTION COL2ROW
35
36// RGB matrix
37#define DRIVER_ADDR_1 0b1110100
38#define DRIVER_COUNT 1
39#define DRIVER_1_LED_TOTAL (4 * 8 * 3)
40#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL)
41#define RGB_DISABLE_WHEN_USB_SUSPENDED true
42#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_SPIRAL
43#define RGB_MATRIX_DISABLE_KEYCODES
44
45// Set 0 if debouncing isn't needed
46#define DEBOUNCE 5
47
48#define FORCE_NKRO
49
50// Slim down the ROM
51#define NO_ACTION_LAYER
52#define NO_ACTION_TAPPING
53#define NO_ACTION_ONESHOT
diff --git a/keyboards/opendeck/32/rev1/rev1.c b/keyboards/opendeck/32/rev1/rev1.c
new file mode 100644
index 000000000..297af907e
--- /dev/null
+++ b/keyboards/opendeck/32/rev1/rev1.c
@@ -0,0 +1,145 @@
1/* Copyright 2020 cmdremily
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "rev1.h"
18
19#ifdef RGB_MATRIX_ENABLE
20const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
21 /* Refer to IS31 manual for these locations
22 * driver
23 * | R location
24 * | | G location
25 * | | | B location
26 * | | | | */
27 // clang-format off
28 {0, C4_1, C5_1, C6_1},
29 {0, C4_2, C5_2, C6_2},
30 {0, C4_3, C5_3, C6_3},
31 {0, C1_4, C2_4, C3_4},
32 {0, C4_9, C5_9, C6_9},
33 {0, C4_10, C5_10, C6_10},
34 {0, C4_11, C5_11, C6_11},
35 {0, C1_12, C2_12, C3_12},
36
37 {0, C7_1, C8_1, C9_1},
38 {0, C7_2, C8_2, C9_2},
39 {0, C7_3, C8_3, C9_3},
40 {0, C7_4, C8_4, C9_4},
41 {0, C7_9, C8_9, C9_9},
42 {0, C7_10, C8_10, C9_10},
43 {0, C7_11, C8_11, C9_11},
44 {0, C7_12, C8_12, C9_12},
45
46 {0, C1_5, C2_5, C3_5},
47 {0, C1_6, C2_6, C3_6},
48 {0, C1_7, C2_7, C3_7},
49 {0, C1_8, C2_8, C3_8},
50 {0, C1_13, C2_13, C3_13},
51 {0, C1_14, C2_14, C3_14},
52 {0, C1_15, C2_15, C3_15},
53 {0, C1_16, C2_16, C3_16},
54
55 {0, C7_5, C8_5, C9_5},
56 {0, C7_6, C8_6, C9_6},
57 {0, C4_7, C5_7, C6_7},
58 {0, C4_8, C5_8, C6_8},
59 {0, C7_13, C8_13, C9_13},
60 {0, C7_14, C8_14, C9_14},
61 {0, C4_15, C5_15, C6_15},
62 {0, C4_16, C5_16, C6_16},
63 // clang-format on
64};
65
66#define P(x,y) {(x*224 / (MATRIX_COLS - 1)), (y*64 / (MATRIX_ROWS - 1))}
67// clang-format off
68led_config_t g_led_config = {
69 // Key Matrix to LED Index
70 {
71 {0, 1, 2, 3, 4, 5, 6, 7},
72 {8, 9, 10, 11, 12, 13, 14, 15},
73 {16, 17, 18, 19, 20, 21, 22, 23},
74 {24, 25, 26, 27, 28, 29, 30, 31}
75 }, {
76 // LED Index to Physical Position
77 P(0, 0), P(1, 0), P(2, 0), P(3, 0), P(4, 0), P(5, 0), P(6, 0), P(7, 0),
78 P(0, 1), P(1, 1), P(2, 1), P(3, 1), P(4, 1), P(5, 1), P(6, 1), P(7, 1),
79 P(0, 2), P(1, 2), P(2, 2), P(3, 2), P(4, 2), P(5, 2), P(6, 2), P(7, 2),
80 P(0, 3), P(1, 3), P(2, 3), P(3, 3), P(4, 3), P(5, 3), P(6, 3), P(7, 3),
81 }, {
82 // LED Index to Flag
83 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
84 }
85};
86#undef P
87
88// clang-format on
89
90// Set custom key colors here, in order to change the RGB effect, either reserve some keys
91// in the keymap to adjust the pattern (see QMK docs, incompatible with wrapper keys) or
92// change the default pattern in config.h.
93/*
94void rgb_matrix_indicators_kb(void) {
95 //rgb_matrix_set_color(0, 255, 255, 255);
96 //rgb_matrix_set_color_all(0x86,0xff,0xff);
97}
98*/
99
100void keyboard_pre_init_kb(void) {
101 // Light power LED
102 setPinOutput(POWER_LED_PIN);
103 writePinLow(POWER_LED_PIN);
104
105 // Enable RGB driver IC
106 setPinOutput(RGB_DISABLE_N_PIN);
107 writePinHigh(RGB_DISABLE_N_PIN);
108
109 // We don't use this feature of the IS31FL3731 but it is electrically connected
110 // Make sure not to drive it
111 setPinInput(RGB_IRQ_N_PIN);
112}
113
114void keyboard_post_init_user() {
115 // RGB enabled by default, no way to turn off. No need to expend EEPROM write cycles here.
116 rgb_matrix_enable_noeeprom();
117}
118#endif
119
120#if defined(KC_WRAPPER_KEY)
121
122static uint8_t g_key_wrapper_tracker = 0;
123
124bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
125 if (!process_record_user(keycode, record) { return false; }
126 if (record->event.pressed && keycode != KC_WRAPPER_KEY) {
127 register_code(KC_WRAPPER_KEY);
128 register_code(keycode);
129 g_key_wrapper_tracker++;
130 return false;
131 }
132 return true;
133}
134
135void post_process_record_kb(uint16_t keycode, keyrecord_t *record) {
136 if (!record->event.pressed && keycode != KC_WRAPPER_KEY) {
137 --g_key_wrapper_tracker;
138 if (g_key_wrapper_tracker <= 0) {
139 unregister_code(KC_WRAPPER_KEY);
140 g_key_wrapper_tracker = 0;
141 }
142 }
143 post_process_record_user(keycode, record);
144}
145#endif
diff --git a/keyboards/opendeck/32/rev1/rev1.h b/keyboards/opendeck/32/rev1/rev1.h
new file mode 100644
index 000000000..9c208df8a
--- /dev/null
+++ b/keyboards/opendeck/32/rev1/rev1.h
@@ -0,0 +1,45 @@
1/* Copyright 2020 cmdremily
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#include "quantum.h"
20
21#define POWER_LED_PIN F1
22#define RGB_DISABLE_N_PIN D2
23#define RGB_IRQ_N_PIN D3
24
25// If you want something similar to what Taran from LMG does in https://github.com/TaranVH/2nd-keyboard
26// you can create a "wrapper key" by uncommenting the row below and chosing your wrapper keycode.
27// You can then change the keymap in ../keymaps/default/keymap.c to adjust what key is sent inside the
28// wrapper.
29// Note: The default is to not wrap and to send F13-F24 with combinations of shift/control/alt as these
30// are immediately usable in most software (e.g. OBS and DCSB for streaming) without using AHK.
31//#define KC_WRAPPER_KEY KC_F24
32
33// clang-format off
34#define LAYOUT_ortho_4x8( \
35 Q00, Q01, Q02, Q03, Q04, Q05, Q06, Q07, \
36 Q10, Q11, Q12, Q13, Q14, Q15, Q16, Q17, \
37 Q20, Q21, Q22, Q23, Q24, Q25, Q26, Q27, \
38 Q30, Q31, Q32, Q33, Q34, Q35, Q36, Q37 \
39) { \
40 {Q00, Q01, Q02, Q03, Q04, Q05, Q06, Q07}, \
41 {Q10, Q11, Q12, Q13, Q14, Q15, Q16, Q17}, \
42 {Q20, Q21, Q22, Q23, Q24, Q25, Q26, Q27}, \
43 {Q30, Q31, Q32, Q33, Q34, Q35, Q36, Q37} \
44}
45// clang-format on
diff --git a/keyboards/opendeck/32/rev1/rules.mk b/keyboards/opendeck/32/rev1/rules.mk
new file mode 100644
index 000000000..f4f4fa8af
--- /dev/null
+++ b/keyboards/opendeck/32/rev1/rules.mk
@@ -0,0 +1,28 @@
1# MCU name
2MCU = atmega32u4
3
4# Processor frequency
5F_CPU = 8000000
6
7# Bootloader selection
8BOOTLOADER = atmel-dfu
9
10# Build Options
11# change yes to no to disable
12#
13BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
14MOUSEKEY_ENABLE = no # Mouse keys
15EXTRAKEY_ENABLE = no # Audio control and System control
16CONSOLE_ENABLE = no # Console for debug
17COMMAND_ENABLE = no # Commands for debug and configuration
18# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
19SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
20# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
21NKRO_ENABLE = yes # USB Nkey Rollover
22BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
23RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
24BLUETOOTH_ENABLE = no # Enable Bluetooth
25AUDIO_ENABLE = no # Audio output
26RGB_MATRIX_ENABLE = IS31FL3731
27
28LTO_ENABLE = yes
diff --git a/keyboards/opendeck/info.json b/keyboards/opendeck/info.json
new file mode 100644
index 000000000..7ee0ba60d
--- /dev/null
+++ b/keyboards/opendeck/info.json
@@ -0,0 +1,4 @@
1{
2 "url": "https://github.com/cmdremily/OpenDeck",
3 "maintainer": "cmdremily"
4}
diff --git a/keyboards/opendeck/readme.md b/keyboards/opendeck/readme.md
new file mode 100644
index 000000000..fb2d01e88
--- /dev/null
+++ b/keyboards/opendeck/readme.md
@@ -0,0 +1,19 @@
1# OpenDeck
2
3A OSH/OSW stream deck for streamers
4
5* Keyboard Maintainer: [cmdremily](https://github.com/cmdremily/)
6* Hardware Supported: OpenDeck32
7* Hardware Availability: [OSH on GitHub](https://github.com/cmdremily/OpenDeck)
8
9Make example for this keyboard (after setting up your build environment):
10
11 make opendeck/32/rev1:default
12
13Flashing example for this keyboard:
14
15 make opendeck/32/rev1:default:flash
16
17then press the reset switch on the PCB.
18
19See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).