aboutsummaryrefslogtreecommitdiff
path: root/keyboards/nightly_boards
diff options
context:
space:
mode:
authorNightlyBoards <65656486+NightlyBoards@users.noreply.github.com>2021-01-11 14:18:28 +0800
committerGitHub <noreply@github.com>2021-01-10 22:18:28 -0800
commitb1419742a51cd597548dff0059a4ba3781e9b984 (patch)
tree81a4b05c8a76f4ae4fe5aeda90625ce085877fcb /keyboards/nightly_boards
parent65d8ac47598aa4aa439181627743749d18a19558 (diff)
downloadqmk_firmware-b1419742a51cd597548dff0059a4ba3781e9b984.tar.gz
qmk_firmware-b1419742a51cd597548dff0059a4ba3781e9b984.zip
[Keyboard] Add the [n]40-o (#11286)
* Create Alter folder * Revert "Create Alter folder" This reverts commit 361103b821dbb22957b66cdedb0d11f996def71c. * Added the n40_o folder * Edited info.json, n40_o.h and rules.mk * Edited readme as per comment
Diffstat (limited to 'keyboards/nightly_boards')
-rw-r--r--keyboards/nightly_boards/n40_o/config.h84
-rw-r--r--keyboards/nightly_boards/n40_o/encoder_action.c51
-rw-r--r--keyboards/nightly_boards/n40_o/encoder_action.h21
-rw-r--r--keyboards/nightly_boards/n40_o/info.json191
-rw-r--r--keyboards/nightly_boards/n40_o/keymaps/default/keymap.c26
-rw-r--r--keyboards/nightly_boards/n40_o/keymaps/ortho_4x13_1x2u_c/keymap.c26
-rw-r--r--keyboards/nightly_boards/n40_o/keymaps/ortho_4x13_encoders/keymap.c26
-rw-r--r--keyboards/nightly_boards/n40_o/keymaps/via/keymap.c48
-rw-r--r--keyboards/nightly_boards/n40_o/keymaps/via/rules.mk2
-rw-r--r--keyboards/nightly_boards/n40_o/n40_o.c27
-rw-r--r--keyboards/nightly_boards/n40_o/n40_o.h68
-rw-r--r--keyboards/nightly_boards/n40_o/readme.md20
-rw-r--r--keyboards/nightly_boards/n40_o/rules.mk27
13 files changed, 617 insertions, 0 deletions
diff --git a/keyboards/nightly_boards/n40_o/config.h b/keyboards/nightly_boards/n40_o/config.h
new file mode 100644
index 000000000..e0bcdbe01
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/config.h
@@ -0,0 +1,84 @@
1/*
2Copyright 2020 Neil Brian Ramirez
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xD812
24#define PRODUCT_ID 0x0009
25#define DEVICE_VER 0x0001
26#define MANUFACTURER Neil Brian Ramirez
27#define PRODUCT [n]40-o
28
29/* key matrix size */
30#define MATRIX_ROWS 5
31#define MATRIX_COLS 13
32
33/*
34 * Keyboard Matrix Assignments
35 *
36 * Change this to how you wired your keyboard
37 * COLS: AVR pins used for columns, left to right
38 * ROWS: AVR pins used for rows, top to bottom
39 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
40 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
41 *
42 */
43#define MATRIX_ROW_PINS { E6, F0, F1, D7, NO_PIN }
44#define MATRIX_COL_PINS { B5, C7, D6, D4, B3, B2, B1, B0, D5, D3, D2, D1, D0 }
45#define UNUSED_PINS
46
47/* COL2ROW, ROW2COL*/
48#define DIODE_DIRECTION COL2ROW
49
50#define RGB_DI_PIN B4
51#ifdef RGB_DI_PIN
52#define RGBLED_NUM 12
53#define RGBLIGHT_ANIMATIONS
54
55#endif
56
57/* Encoders */
58
59#define ENCODERS 3
60
61#define ENCODERS_PAD_A { F6, F4 , B6 }
62#define ENCODERS_PAD_B { F7, F5 , C6 }
63
64#define ENCODERS_CW_KEY { { 2, 4 },{ 4, 4 },{ 6, 4 } }
65#define ENCODERS_CCW_KEY { { 1, 4 },{ 3, 4 },{ 5, 4 } }
66
67/* Audio */
68
69#define B7_AUDIO
70
71#define AUDIO_CLICKY
72
73/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
74#define DEBOUNCE 5
75
76/* define if matrix has ghost (lacks anti-ghosting diodes) */
77//#define MATRIX_HAS_GHOST
78
79/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
80#define LOCKING_SUPPORT_ENABLE
81/* Locking resynchronize hack */
82#define LOCKING_RESYNC_ENABLE
83
84
diff --git a/keyboards/nightly_boards/n40_o/encoder_action.c b/keyboards/nightly_boards/n40_o/encoder_action.c
new file mode 100644
index 000000000..042a3871c
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/encoder_action.c
@@ -0,0 +1,51 @@
1/* Copyright 2020 Neil Brian Ramirez
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 3 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 "encoder_action.h"
18
19#ifdef ENCODERS
20static uint8_t encoder_state[ENCODERS] = {0};
21static keypos_t encoder_cw[ENCODERS] = ENCODERS_CW_KEY;
22static keypos_t encoder_ccw[ENCODERS] = ENCODERS_CCW_KEY;
23#endif
24
25void encoder_action_unregister(void) {
26#ifdef ENCODERS
27 for (int index = 0; index < ENCODERS; ++index) {
28 if (encoder_state[index]) {
29 keyevent_t encoder_event = (keyevent_t) {
30 .key = encoder_state[index] >> 1 ? encoder_cw[index] : encoder_ccw[index],
31 .pressed = false,
32 .time = (timer_read() | 1)
33 };
34 encoder_state[index] = 0;
35 action_exec(encoder_event);
36 }
37 }
38#endif
39}
40
41void encoder_action_register(uint8_t index, bool clockwise) {
42#ifdef ENCODERS
43 keyevent_t encoder_event = (keyevent_t) {
44 .key = clockwise ? encoder_cw[index] : encoder_ccw[index],
45 .pressed = true,
46 .time = (timer_read() | 1)
47 };
48 encoder_state[index] = (clockwise ^ 1) | (clockwise << 1);
49 action_exec(encoder_event);
50#endif
51}
diff --git a/keyboards/nightly_boards/n40_o/encoder_action.h b/keyboards/nightly_boards/n40_o/encoder_action.h
new file mode 100644
index 000000000..098210d40
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/encoder_action.h
@@ -0,0 +1,21 @@
1/* Copyright 2020 Neil Brian Ramirez
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 3 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 "quantum.h"
18
19void encoder_action_unregister(void);
20
21void encoder_action_register(uint8_t index, bool clockwise); \ No newline at end of file
diff --git a/keyboards/nightly_boards/n40_o/info.json b/keyboards/nightly_boards/n40_o/info.json
new file mode 100644
index 000000000..4f037ec05
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/info.json
@@ -0,0 +1,191 @@
1{
2 "keyboard_name": "[n]40-o",
3 "url": "",
4 "maintainer": "Neil Brian Ramirez",
5 "width": 15.5,
6 "height": 4,
7 "layouts": {
8 "LAYOUT_ortho_4x13_encoders": {
9 "layout": [
10 {"x":0, "y":0},
11 {"x":1, "y":0},
12 {"x":2.25, "y":0},
13 {"x":3.5, "y":0},
14 {"x":4.5, "y":0},
15 {"x":5.5, "y":0},
16 {"x":6.5, "y":0},
17 {"x":7.5, "y":0},
18 {"x":8.5, "y":0},
19 {"x":9.5, "y":0},
20 {"x":10.5, "y":0},
21 {"x":11.5, "y":0},
22 {"x":12.5, "y":0},
23 {"x":13.5, "y":0},
24 {"x":14.5, "y":0},
25
26 {"x":0, "y":1},
27 {"x":1, "y":1},
28 {"x":2.25, "y":1},
29 {"x":3.5, "y":1},
30 {"x":4.5, "y":1},
31 {"x":5.5, "y":1},
32 {"x":6.5, "y":1},
33 {"x":7.5, "y":1},
34 {"x":8.5, "y":1},
35 {"x":9.5, "y":1},
36 {"x":10.5, "y":1},
37 {"x":11.5, "y":1},
38 {"x":12.5, "y":1},
39 {"x":13.5, "y":1},
40 {"x":14.5, "y":1},
41
42 {"x":0, "y":2},
43 {"x":1, "y":2},
44 {"x":2.25, "y":2},
45 {"x":3.5, "y":2},
46 {"x":4.5, "y":2},
47 {"x":5.5, "y":2},
48 {"x":6.5, "y":2},
49 {"x":7.5, "y":2},
50 {"x":8.5, "y":2},
51 {"x":9.5, "y":2},
52 {"x":10.5, "y":2},
53 {"x":11.5, "y":2},
54 {"x":12.5, "y":2},
55 {"x":13.5, "y":2},
56 {"x":14.5, "y":2},
57
58 {"x":2.25, "y":3},
59 {"x":3.5, "y":3},
60 {"x":4.5, "y":3},
61 {"x":5.5, "y":3},
62 {"x":6.5, "y":3},
63 {"x":7.5, "y":3},
64 {"x":8.5, "y":3},
65 {"x":9.5, "y":3},
66 {"x":10.5, "y":3},
67 {"x":11.5, "y":3},
68 {"x":12.5, "y":3},
69 {"x":13.5, "y":3},
70 {"x":14.5, "y":3}
71 ]
72 },
73 "LAYOUT_ortho_4x13": {
74 "layout": [
75 {"x":0, "y":0},
76 {"x":1.25, "y":0},
77 {"x":2.25, "y":0},
78 {"x":3.25, "y":0},
79 {"x":4.25, "y":0},
80 {"x":5.25, "y":0},
81 {"x":6.25, "y":0},
82 {"x":7.25, "y":0},
83 {"x":8.25, "y":0},
84 {"x":9.25, "y":0},
85 {"x":10.25, "y":0},
86 {"x":11.25, "y":0},
87 {"x":12.25, "y":0},
88
89 {"x":0, "y":1},
90 {"x":1.25, "y":1},
91 {"x":2.25, "y":1},
92 {"x":3.25, "y":1},
93 {"x":4.25, "y":1},
94 {"x":5.25, "y":1},
95 {"x":6.25, "y":1},
96 {"x":7.25, "y":1},
97 {"x":8.25, "y":1},
98 {"x":9.25, "y":1},
99 {"x":10.25, "y":1},
100 {"x":11.25, "y":1},
101 {"x":12.25, "y":1},
102
103 {"x":0, "y":2},
104 {"x":1.25, "y":2},
105 {"x":2.25, "y":2},
106 {"x":3.25, "y":2},
107 {"x":4.25, "y":2},
108 {"x":5.25, "y":2},
109 {"x":6.25, "y":2},
110 {"x":7.25, "y":2},
111 {"x":8.25, "y":2},
112 {"x":9.25, "y":2},
113 {"x":10.25, "y":2},
114 {"x":11.25, "y":2},
115 {"x":12.25, "y":2},
116
117 {"x":0, "y":3},
118 {"x":1.25, "y":3},
119 {"x":2.25, "y":3},
120 {"x":3.25, "y":3},
121 {"x":4.25, "y":3},
122 {"x":5.25, "y":3},
123 {"x":6.25, "y":3},
124 {"x":7.25, "y":3},
125 {"x":8.25, "y":3},
126 {"x":9.25, "y":3},
127 {"x":10.25, "y":3},
128 {"x":11.25, "y":3},
129 {"x":12.25, "y":3}
130 ]
131 },
132 "LAYOUT_ortho_4x13_1x2u_c": {
133 "layout": [
134 {"x":0, "y":0},
135 {"x":1.25, "y":0},
136 {"x":2.25, "y":0},
137 {"x":3.25, "y":0},
138 {"x":4.25, "y":0},
139 {"x":5.25, "y":0},
140 {"x":6.25, "y":0},
141 {"x":7.25, "y":0},
142 {"x":8.25, "y":0},
143 {"x":9.25, "y":0},
144 {"x":10.25, "y":0},
145 {"x":11.25, "y":0},
146 {"x":12.25, "y":0},
147
148 {"x":0, "y":1},
149 {"x":1.25, "y":1},
150 {"x":2.25, "y":1},
151 {"x":3.25, "y":1},
152 {"x":4.25, "y":1},
153 {"x":5.25, "y":1},
154 {"x":6.25, "y":1},
155 {"x":7.25, "y":1},
156 {"x":8.25, "y":1},
157 {"x":9.25, "y":1},
158 {"x":10.25, "y":1},
159 {"x":11.25, "y":1},
160 {"x":12.25, "y":1},
161
162 {"x":0, "y":2},
163 {"x":1.25, "y":2},
164 {"x":2.25, "y":2},
165 {"x":3.25, "y":2},
166 {"x":4.25, "y":2},
167 {"x":5.25, "y":2},
168 {"x":6.25, "y":2},
169 {"x":7.25, "y":2},
170 {"x":8.25, "y":2},
171 {"x":9.25, "y":2},
172 {"x":10.25, "y":2},
173 {"x":11.25, "y":2},
174 {"x":12.25, "y":2},
175
176 {"x":0, "y":3},
177 {"x":1.25, "y":3},
178 {"x":2.25, "y":3},
179 {"x":3.25, "y":3},
180 {"x":4.25, "y":3},
181 {"x":5.25, "y":3},
182 {"x":6.25, "y":3, "w":2},
183 {"x":8.25, "y":3},
184 {"x":9.25, "y":3},
185 {"x":10.25, "y":3},
186 {"x":11.25, "y":3},
187 {"x":12.25, "y":3}
188 ]
189 }
190 }
191} \ No newline at end of file
diff --git a/keyboards/nightly_boards/n40_o/keymaps/default/keymap.c b/keyboards/nightly_boards/n40_o/keymaps/default/keymap.c
new file mode 100644
index 000000000..658b43689
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/keymaps/default/keymap.c
@@ -0,0 +1,26 @@
1/* Copyright 2020 Neil Brian Ramirez
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
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_ortho_4x13(
21 KC_SPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
22 KC_SPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
23 KC_SPC, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
24 KC_SPC, KC_SPC, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
25 ),
26};
diff --git a/keyboards/nightly_boards/n40_o/keymaps/ortho_4x13_1x2u_c/keymap.c b/keyboards/nightly_boards/n40_o/keymaps/ortho_4x13_1x2u_c/keymap.c
new file mode 100644
index 000000000..55f22cdc4
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/keymaps/ortho_4x13_1x2u_c/keymap.c
@@ -0,0 +1,26 @@
1/* Copyright 2020 Neil Brian Ramirez
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
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_ortho_4x13_1x2u_c(
21 KC_SPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
22 KC_SPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
23 KC_SPC, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
24 KC_SPC, KC_SPC, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
25 ),
26};
diff --git a/keyboards/nightly_boards/n40_o/keymaps/ortho_4x13_encoders/keymap.c b/keyboards/nightly_boards/n40_o/keymaps/ortho_4x13_encoders/keymap.c
new file mode 100644
index 000000000..f6e0dc23e
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/keymaps/ortho_4x13_encoders/keymap.c
@@ -0,0 +1,26 @@
1/* Copyright 2020 Neil Brian Ramirez
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
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_ortho_4x13_encoders(
21 KC_SPC, KC_SPC, KC_SPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
22 KC_SPC, KC_SPC, KC_SPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
23 KC_SPC, KC_SPC, KC_SPC, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
24 KC_SPC, KC_SPC, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
25 ),
26};
diff --git a/keyboards/nightly_boards/n40_o/keymaps/via/keymap.c b/keyboards/nightly_boards/n40_o/keymaps/via/keymap.c
new file mode 100644
index 000000000..830d8d878
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/keymaps/via/keymap.c
@@ -0,0 +1,48 @@
1/* Copyright 2020 Neil Brian Ramirez
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
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_ortho_4x13_encoders(
21 KC_SPC, KC_SPC, KC_SPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
22 KC_SPC, KC_SPC, KC_SPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
23 KC_SPC, KC_SPC, KC_SPC, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
24 KC_SPC, KC_SPC, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
25
26 ),
27 [1] = LAYOUT_ortho_4x13_encoders(
28 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
29 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
31 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
32
33 ),
34 [2] = LAYOUT_ortho_4x13_encoders(
35 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
37 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
38 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
39
40 ),
41 [3] = LAYOUT_ortho_4x13_encoders(
42 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
46
47 ),
48};
diff --git a/keyboards/nightly_boards/n40_o/keymaps/via/rules.mk b/keyboards/nightly_boards/n40_o/keymaps/via/rules.mk
new file mode 100644
index 000000000..43061db1d
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
1VIA_ENABLE = yes
2LTO_ENABLE = yes \ No newline at end of file
diff --git a/keyboards/nightly_boards/n40_o/n40_o.c b/keyboards/nightly_boards/n40_o/n40_o.c
new file mode 100644
index 000000000..a91a0716b
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/n40_o.c
@@ -0,0 +1,27 @@
1/* Copyright 2020 Neil Brian Ramirez
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 "n40_o.h"
18
19void matrix_scan_kb(void) {
20 encoder_action_unregister();
21 matrix_scan_user();
22}
23
24void encoder_update_kb(uint8_t index, bool clockwise) {
25 encoder_action_register(index, clockwise);
26 // encoder_update_user(index, clockwise);
27}; \ No newline at end of file
diff --git a/keyboards/nightly_boards/n40_o/n40_o.h b/keyboards/nightly_boards/n40_o/n40_o.h
new file mode 100644
index 000000000..d7c44d9d8
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/n40_o.h
@@ -0,0 +1,68 @@
1/* Copyright 2020 Neil Brian Ramirez
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#include "encoder_action.h"
21
22/* This is a shortcut to help you visually see your layout.
23 *
24 * The first section contains all of the arguments representing the physical
25 * layout of the board and position of the keys.
26 *
27 * The second converts the arguments into a two-dimensional array which
28 * represents the switch matrix.
29 */
30
31#define LAYOUT_ortho_4x13( \
32 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
33 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
34 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
35 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \
36) { \
37 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \
38 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \
39 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \
40 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \
41 { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
42}
43
44#define LAYOUT_ortho_4x13_1x2u_c( \
45 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
46 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
47 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
48 K30, K31, K32, K33, K34, K35, K36, K38, K39, K3A, K3B, K3C \
49) { \
50 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \
51 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \
52 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \
53 { K30, K31, K32, K33, K34, K35, K36, KC_NO, K38, K39, K3A, K3B, K3C }, \
54 { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
55}
56
57#define LAYOUT_ortho_4x13_encoders( \
58 E00A, E00B, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
59 E01A, E01B, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \
60 E02A, E02B, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \
61 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \
62) { \
63 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \
64 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \
65 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \
66 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \
67 { KC_NO, E00A, E00B, E01A, E01B, E02A, E02B, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
68}
diff --git a/keyboards/nightly_boards/n40_o/readme.md b/keyboards/nightly_boards/n40_o/readme.md
new file mode 100644
index 000000000..620cec8b7
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/readme.md
@@ -0,0 +1,20 @@
1# Nightly Boards [n]40-o
2
3![[n]40-o](https://i.imgur.com/CFIKCXNl.jpg)
4
5A 4x12 Ortholinear keyboard with left-side macro keys that supports three rotary encoders
6
7* Keyboard Maintainer: [Neil Brian Ramirez](https://github.com/NightlyBoards)
8* Hardware Supported: atmega32u4
9
10Make example for this keyboard (after setting up your build environment):
11
12 make nightly_boards/n40_o:default
13
14Flashing example for this keyboard:
15
16 make nightly_boards/n40_o:default:flash
17
18You can enter bootloader mode by pressing the physical reset button at the back of the pcb or by holding the upper left key/rotary encoder while plugging the usb cable.
19
20See 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).
diff --git a/keyboards/nightly_boards/n40_o/rules.mk b/keyboards/nightly_boards/n40_o/rules.mk
new file mode 100644
index 000000000..0eeb14fdc
--- /dev/null
+++ b/keyboards/nightly_boards/n40_o/rules.mk
@@ -0,0 +1,27 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = atmel-dfu
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = yes # Audio output
23ENCODER_ENABLE = yes # Enable Rotary Encoders
24LTO_ENABLE = yes
25
26# Added encoder Action
27SRC += encoder_action.c \ No newline at end of file