aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/keebwerk/nano_slider/config.h221
-rw-r--r--keyboards/keebwerk/nano_slider/info.json21
-rw-r--r--keyboards/keebwerk/nano_slider/keymaps/default/keymap.c86
-rw-r--r--keyboards/keebwerk/nano_slider/keymaps/default/readme.md1
-rw-r--r--keyboards/keebwerk/nano_slider/nano_slider.c18
-rw-r--r--keyboards/keebwerk/nano_slider/nano_slider.h36
-rw-r--r--keyboards/keebwerk/nano_slider/readme.md15
-rw-r--r--keyboards/keebwerk/nano_slider/rules.mk31
8 files changed, 429 insertions, 0 deletions
diff --git a/keyboards/keebwerk/nano_slider/config.h b/keyboards/keebwerk/nano_slider/config.h
new file mode 100644
index 000000000..ba079c531
--- /dev/null
+++ b/keyboards/keebwerk/nano_slider/config.h
@@ -0,0 +1,221 @@
1/*
2Copyright 2020 Duckle
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 0x03A8
24#define PRODUCT_ID 0x0000
25#define DEVICE_VER 0x0001
26#define MANUFACTURER keebwerk.
27#define PRODUCT nano. slider
28#define DESCRIPTION A small eight key macropad
29
30/* key matrix size */
31#define MATRIX_ROWS 2
32#define MATRIX_COLS 4
33
34/*
35 * Keyboard Matrix Assignments
36 */
37#define MATRIX_ROW_PINS { F0, F1 }
38#define MATRIX_COL_PINS { B0, B1, B2, B3 }
39#define UNUSED_PINS
40
41#define SLIDER_PIN D4
42
43/* COL2ROW, ROW2COL*/
44#define DIODE_DIRECTION COL2ROW
45
46#define BACKLIGHT_PIN B7
47#define BACKLIGHT_BREATHING
48#define BACKLIGHT_LEVELS 3
49
50#define RGB_DI_PIN F6
51#ifdef RGB_DI_PIN
52# define RGBLED_NUM 4
53# define RGBLIGHT_HUE_STEP 8
54# define RGBLIGHT_SAT_STEP 8
55# define RGBLIGHT_VAL_STEP 8
56# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
57# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
58 /*== all animations enable ==*/
59# define RGBLIGHT_ANIMATIONS
60// /*== or choose animations ==*/
61// #define RGBLIGHT_EFFECT_BREATHING
62// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
63// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
64// #define RGBLIGHT_EFFECT_SNAKE
65// #define RGBLIGHT_EFFECT_KNIGHT
66// #define RGBLIGHT_EFFECT_CHRISTMAS
67// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
68// #define RGBLIGHT_EFFECT_RGB_TEST
69// #define RGBLIGHT_EFFECT_ALTERNATING
70// /*== customize breathing effect ==*/
71// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
72// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
73// /*==== use exp() and sin() ====*/
74// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
75// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
76#endif
77
78/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
79#define DEBOUNCE 5
80
81/* define if matrix has ghost (lacks anti-ghosting diodes) */
82//#define MATRIX_HAS_GHOST
83
84/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
85#define LOCKING_SUPPORT_ENABLE
86/* Locking resynchronize hack */
87#define LOCKING_RESYNC_ENABLE
88
89/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
90 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
91 */
92// #define GRAVE_ESC_CTRL_OVERRIDE
93
94/*
95 * Magic Key Options
96 *
97 * Magic keys are hotkey commands that allow control over firmware functions of
98 * the keyboard. They are best used in combination with the HID Listen program,
99 * found here: https://www.pjrc.com/teensy/hid_listen.html
100 *
101 * The options below allow the magic key functionality to be changed. This is
102 * useful if your keyboard/keypad is missing keys and you want magic key support.
103 *
104 */
105
106/* key combination for magic key command */
107/* defined by default; to change, uncomment and set to the combination you want */
108// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
109
110/* control how magic key switches layers */
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
112//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
113//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
114
115/* override magic key keymap */
116//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
117//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
118//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
119//#define MAGIC_KEY_HELP H
120//#define MAGIC_KEY_HELP_ALT SLASH
121//#define MAGIC_KEY_DEBUG D
122//#define MAGIC_KEY_DEBUG_MATRIX X
123//#define MAGIC_KEY_DEBUG_KBD K
124//#define MAGIC_KEY_DEBUG_MOUSE M
125//#define MAGIC_KEY_VERSION V
126//#define MAGIC_KEY_STATUS S
127//#define MAGIC_KEY_CONSOLE C
128//#define MAGIC_KEY_LAYER0 0
129//#define MAGIC_KEY_LAYER0_ALT GRAVE
130//#define MAGIC_KEY_LAYER1 1
131//#define MAGIC_KEY_LAYER2 2
132//#define MAGIC_KEY_LAYER3 3
133//#define MAGIC_KEY_LAYER4 4
134//#define MAGIC_KEY_LAYER5 5
135//#define MAGIC_KEY_LAYER6 6
136//#define MAGIC_KEY_LAYER7 7
137//#define MAGIC_KEY_LAYER8 8
138//#define MAGIC_KEY_LAYER9 9
139//#define MAGIC_KEY_BOOTLOADER B
140//#define MAGIC_KEY_BOOTLOADER_ALT ESC
141//#define MAGIC_KEY_LOCK CAPS
142//#define MAGIC_KEY_EEPROM E
143//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
144//#define MAGIC_KEY_NKRO N
145//#define MAGIC_KEY_SLEEP_LED Z
146
147/*
148 * Feature disable options
149 * These options are also useful to firmware size reduction.
150 */
151
152/* disable debug print */
153//#define NO_DEBUG
154
155/* disable print */
156//#define NO_PRINT
157
158/* disable action features */
159//#define NO_ACTION_LAYER
160//#define NO_ACTION_TAPPING
161//#define NO_ACTION_ONESHOT
162
163/* disable these deprecated features by default */
164#ifndef LINK_TIME_OPTIMIZATION_ENABLE
165# define NO_ACTION_MACRO
166# define NO_ACTION_FUNCTION
167#endif
168/*
169 * MIDI options
170 */
171
172/* Prevent use of disabled MIDI features in the keymap */
173//#define MIDI_ENABLE_STRICT 1
174
175/* enable basic MIDI features:
176 - MIDI notes can be sent when in Music mode is on
177*/
178//#define MIDI_BASIC
179
180/* enable advanced MIDI features:
181 - MIDI notes can be added to the keymap
182 - Octave shift and transpose
183 - Virtual sustain, portamento, and modulation wheel
184 - etc.
185*/
186#define MIDI_ADVANCED
187
188/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
189//#define MIDI_TONE_KEYCODE_OCTAVES 1
190
191/*
192 * HD44780 LCD Display Configuration
193 */
194/*
195#define LCD_LINES 2 //< number of visible lines of the display
196#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
197
198#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
199
200#if LCD_IO_MODE
201#define LCD_PORT PORTB //< port for the LCD lines
202#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
203#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
204#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
205#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
206#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
207#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
208#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
209#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
210#define LCD_RS_PORT LCD_PORT //< port for RS line
211#define LCD_RS_PIN 3 //< pin for RS line
212#define LCD_RW_PORT LCD_PORT //< port for RW line
213#define LCD_RW_PIN 2 //< pin for RW line
214#define LCD_E_PORT LCD_PORT //< port for Enable line
215#define LCD_E_PIN 1 //< pin for Enable line
216#endif
217*/
218
219/* Bootmagic Lite key configuration */
220// #define BOOTMAGIC_LITE_ROW 0
221// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/keebwerk/nano_slider/info.json b/keyboards/keebwerk/nano_slider/info.json
new file mode 100644
index 000000000..f6a9e9a02
--- /dev/null
+++ b/keyboards/keebwerk/nano_slider/info.json
@@ -0,0 +1,21 @@
1{
2 "keyboard_name": "nano. slider",
3 "url": "",
4 "maintainer": "qmk",
5 "width": 4,
6 "height": 3.25,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 {"x":0, "y":0},
11 {"x":0, "y":1.25},
12 {"x":1, "y":1.25},
13 {"x":2, "y":1.25},
14 {"x":0, "y":2.25},
15 {"x":1, "y":2.25},
16 {"x":2, "y":2.25},
17 {"x":3, "y":1.25, "h":2}
18 ]
19 }
20 }
21}
diff --git a/keyboards/keebwerk/nano_slider/keymaps/default/keymap.c b/keyboards/keebwerk/nano_slider/keymaps/default/keymap.c
new file mode 100644
index 000000000..85f2d55ec
--- /dev/null
+++ b/keyboards/keebwerk/nano_slider/keymaps/default/keymap.c
@@ -0,0 +1,86 @@
1/* Copyright 2020 Duckle
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#include "analog.h"
18#include "qmk_midi.h"
19
20// Defines names for use in layer keycodes and the keymap
21enum layer_names {
22 _BASE,
23 _FN,
24 _DEMO
25};
26
27// Defines the keycodes used by our macros in process_record_user
28enum custom_keycodes {
29 QMKBEST = SAFE_RANGE,
30 QMKURL
31};
32
33const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
34 /* Base */
35 [_BASE] = LAYOUT(
36 TO(_FN),
37 KC_1, KC_2, KC_3,
38 KC_4, KC_5, KC_6, KC_0
39 ),
40 [_FN] = LAYOUT(
41 TO(_DEMO),
42 RGB_TOG, RGB_MOD, RGB_VAI,
43 _______, _______, _______, _______
44 ),
45 [_DEMO] = LAYOUT(
46 TO(_BASE),
47 QMKBEST, _______, _______,
48 _______, _______, _______, QMKURL
49 )
50};
51
52bool process_record_user(uint16_t keycode, keyrecord_t *record) {
53 switch (keycode) {
54 case QMKBEST:
55 if (record->event.pressed) {
56 // when keycode QMKBEST is pressed
57 SEND_STRING("QMK is the best thing ever!");
58 } else {
59 // when keycode QMKBEST is released
60 }
61 break;
62 case QMKURL:
63 if (record->event.pressed) {
64 // when keycode QMKURL is pressed
65 SEND_STRING("https://qmk.fm/\n");
66 } else {
67 // when keycode QMKURL is released
68 }
69 break;
70 }
71 return true;
72}
73
74uint8_t divisor = 0;
75
76void slider(void) {
77 if (divisor++) { // only run the slider function 1/256 times it's called
78 return;
79 }
80
81 midi_send_cc(&midi_device, 2, 0x3E, 0x7F - (analogReadPin(SLIDER_PIN) >> 3));
82}
83
84void matrix_scan_user(void) {
85 slider();
86}
diff --git a/keyboards/keebwerk/nano_slider/keymaps/default/readme.md b/keyboards/keebwerk/nano_slider/keymaps/default/readme.md
new file mode 100644
index 000000000..55a880555
--- /dev/null
+++ b/keyboards/keebwerk/nano_slider/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for nano_slider
diff --git a/keyboards/keebwerk/nano_slider/nano_slider.c b/keyboards/keebwerk/nano_slider/nano_slider.c
new file mode 100644
index 000000000..f5730779a
--- /dev/null
+++ b/keyboards/keebwerk/nano_slider/nano_slider.c
@@ -0,0 +1,18 @@
1/* Copyright 2020 Duckle
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 "nano_slider.h"
18
diff --git a/keyboards/keebwerk/nano_slider/nano_slider.h b/keyboards/keebwerk/nano_slider/nano_slider.h
new file mode 100644
index 000000000..31985130b
--- /dev/null
+++ b/keyboards/keebwerk/nano_slider/nano_slider.h
@@ -0,0 +1,36 @@
1/* Copyright 2020 Duckle
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/* This is a shortcut to help you visually see your layout.
22 *
23 * The first section contains all of the arguments representing the physical
24 * layout of the board and position of the keys.
25 *
26 * The second converts the arguments into a two-dimensional array which
27 * represents the switch matrix.
28 */
29#define LAYOUT( \
30 K11, \
31 K12, K10, K00, \
32 K01, K02, K03, K13 \
33) { \
34 { K00, K01, K02, K03 }, \
35 { K10, K11, K12, K13 } \
36}
diff --git a/keyboards/keebwerk/nano_slider/readme.md b/keyboards/keebwerk/nano_slider/readme.md
new file mode 100644
index 000000000..84654f537
--- /dev/null
+++ b/keyboards/keebwerk/nano_slider/readme.md
@@ -0,0 +1,15 @@
1# nano. slider
2
3![nano. slider](https://i.imgur.com/0UxyfxL.png)
4
5A small eight key macropad with slider.
6
7* Keyboard Maintainer: [Duckle29](https://github.com/Duckle29)
8* Hardware Supported: nano. slider PCB, ATmega32U4
9* Hardware Availability: [keebwerk.](https://www.keebwerk.com/product/nano-slider-keyboard/)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make keebwerk/nano_slider:default
14
15See 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/keebwerk/nano_slider/rules.mk b/keyboards/keebwerk/nano_slider/rules.mk
new file mode 100644
index 000000000..3e1d8fe62
--- /dev/null
+++ b/keyboards/keebwerk/nano_slider/rules.mk
@@ -0,0 +1,31 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# ATmega32A bootloadHID
11# ATmega328P USBasp
12BOOTLOADER = atmel-dfu
13
14# Build Options
15BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
16MOUSEKEY_ENABLE = yes # Mouse keys
17EXTRAKEY_ENABLE = yes # Audio control and System control
18CONSOLE_ENABLE = no # Console for debug
19COMMAND_ENABLE = no # Commands for debug and configuration
20# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
21SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
22# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
23NKRO_ENABLE = yes # USB Nkey Rollover
24BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
25RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
26MIDI_ENABLE = yes # MIDI support
27BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
28AUDIO_ENABLE = no # Audio output on port C6
29LTO_ENABLE = yes
30
31SRC += analog.c