aboutsummaryrefslogtreecommitdiff
path: root/keyboards/novelpad
diff options
context:
space:
mode:
authorCole Markham <github@ccmcomputing.net>2018-01-18 22:59:00 -0600
committerJack Humbert <jack.humb@gmail.com>2018-04-11 18:11:42 -0400
commite8082b5f9ecc8cc000823091273576ae58c8411f (patch)
tree1329966a75a244d2de18fdf03ac9302aab292f64 /keyboards/novelpad
parent4cfd1e30fc320dee84840b7af9ed474a6afcfaa6 (diff)
downloadqmk_firmware-e8082b5f9ecc8cc000823091273576ae58c8411f.tar.gz
qmk_firmware-e8082b5f9ecc8cc000823091273576ae58c8411f.zip
Add support for NovelPad/NumChoc by NovelKeys and Woodkeys
Diffstat (limited to 'keyboards/novelpad')
-rwxr-xr-xkeyboards/novelpad/config.h68
-rwxr-xr-xkeyboards/novelpad/keymaps/default/keymap.c127
-rwxr-xr-xkeyboards/novelpad/novelpad.c17
-rwxr-xr-xkeyboards/novelpad/novelpad.h36
-rw-r--r--keyboards/novelpad/readme.md15
-rwxr-xr-xkeyboards/novelpad/rules.mk56
6 files changed, 319 insertions, 0 deletions
diff --git a/keyboards/novelpad/config.h b/keyboards/novelpad/config.h
new file mode 100755
index 000000000..0d6a71343
--- /dev/null
+++ b/keyboards/novelpad/config.h
@@ -0,0 +1,68 @@
1/*
2Copyright 2018 Cole Markham
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#ifndef CONFIG_H
18#define CONFIG_H
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x6070
25#define DEVICE_VER 0x0001
26#define MANUFACTURER NovelKeys.xyz
27#define PRODUCT Novelpad
28#define DESCRIPTION 5x4 Hotswap MX numpad
29
30/* key matrix size */
31#define MATRIX_ROWS 5
32#define MATRIX_COLS 4
33
34/* key matrix pins */
35#define MATRIX_ROW_PINS { C2, C4, C5, C6, C7 }
36#define MATRIX_COL_PINS { D7, D6, D5, D4 }
37#define UNUSED_PINS
38
39/* COL2ROW or ROW2COL */
40#define DIODE_DIRECTION COL2ROW
41
42/* Set 0 if debouncing isn't needed */
43#define DEBOUNCING_DELAY 5
44
45/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
46#define LOCKING_SUPPORT_ENABLE
47
48/* Locking resynchronize hack */
49#define LOCKING_RESYNC_ENABLE
50
51/* key combination for command */
52#define IS_COMMAND() ( \
53 false \
54)
55
56/* prevent stuck modifiers */
57#define PREVENT_STUCK_MODIFIERS
58
59#define BACKLIGHT_LEVELS 10
60#define BACKLIGHT_PIN B7
61
62#ifdef RGBLIGHT_ENABLE
63#define RGB_DI_PIN D3
64#define RGBLIGHT_ANIMATIONS
65#define RGBLED_NUM 4
66#endif
67
68#endif
diff --git a/keyboards/novelpad/keymaps/default/keymap.c b/keyboards/novelpad/keymaps/default/keymap.c
new file mode 100755
index 000000000..59cc1adc8
--- /dev/null
+++ b/keyboards/novelpad/keymaps/default/keymap.c
@@ -0,0 +1,127 @@
1/*
2Copyright 2018 Cole Markham
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#include QMK_KEYBOARD_H
18
19enum custom_keycodes {
20 BL = SAFE_RANGE,
21 WK_RED,
22 WK_GREEN,
23 WK_BLUE
24};
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27
28KEYMAP(
29 KC_NLCK, KC_PSLS, KC_PAST, KC_ESC,
30 KC_P7, KC_P8, KC_P9, KC_PMNS,
31 KC_P4, KC_P5, KC_P6, KC_PPLS,
32 KC_P1, KC_P2, KC_P3, KC_TAB,
33 MO(1), KC_P0, KC_PDOT, KC_ENT),
34
35KEYMAP(
36 KC_TRNS, BL, RGB_MODE_SWIRL, RESET, \
37 RGB_TOG, RGB_MOD, RGB_MODE_PLAIN, RGB_MODE_SNAKE, \
38 RGB_HUI, RGB_SAI, RGB_VAI, RGB_MODE_KNIGHT, \
39 RGB_HUD , RGB_SAD, RGB_VAD, RGB_MODE_XMAS, \
40 KC_TRNS, WK_RED, WK_GREEN, WK_BLUE \
41 ),
42
43};
44
45const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
46 return MACRO_NONE ;
47}
48
49void matrix_init_user(void) {
50
51 rgblight_setrgb(0,255,0);
52}
53
54void matrix_scan_user(void) {
55}
56
57bool process_record_user(uint16_t keycode, keyrecord_t *record) {
58 switch (keycode) {
59 case BL:
60 if (record->event.pressed) {
61#ifdef BACKLIGHT_ENABLE
62 backlight_step();
63#endif
64 }
65 return false;
66 break;
67 case WK_RED:
68 if (record->event.pressed) {
69 rgblight_show_solid_color(0xFF, 0, 0);
70 } else {
71 rgblight_show_solid_color(0xFF, 0xFF, 0xFF);
72 }
73 return false;
74 break;
75 case WK_GREEN:
76 if (record->event.pressed) {
77 rgblight_show_solid_color(0, 0xFF, 0);
78 } else {
79 rgblight_show_solid_color(0xFF, 0xFF, 0xFF);
80 }
81 return false;
82 break;
83 case WK_BLUE:
84 if (record->event.pressed) {
85 rgblight_show_solid_color(0, 0, 0xFF);
86 } else {
87 rgblight_show_solid_color(0xFF, 0xFF, 0xFF);
88 }
89 return false;
90 break;
91 }
92 return true;
93}
94
95void led_set_user(uint8_t usb_led) {
96
97 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
98
99 } else {
100
101 }
102
103 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
104
105 } else {
106
107 }
108
109 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
110
111 } else {
112
113 }
114
115 if (usb_led & (1 << USB_LED_COMPOSE)) {
116
117 } else {
118
119 }
120
121 if (usb_led & (1 << USB_LED_KANA)) {
122
123 } else {
124
125 }
126
127}
diff --git a/keyboards/novelpad/novelpad.c b/keyboards/novelpad/novelpad.c
new file mode 100755
index 000000000..719cb89d6
--- /dev/null
+++ b/keyboards/novelpad/novelpad.c
@@ -0,0 +1,17 @@
1/*
2Copyright 2018 Cole Markham
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#include "novelpad.h"
diff --git a/keyboards/novelpad/novelpad.h b/keyboards/novelpad/novelpad.h
new file mode 100755
index 000000000..079dc30c5
--- /dev/null
+++ b/keyboards/novelpad/novelpad.h
@@ -0,0 +1,36 @@
1/*
2Copyright 2018 Cole Markham
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#ifndef KB_H
18#define KB_H
19
20#include "quantum.h"
21
22#define KEYMAP( \
23 K00, K01, K02, K03, \
24 K10, K11, K12, K13, \
25 K20, K21, K22, K23, \
26 K30, K31, K32, K33, \
27 K40, K41, K42, K43 \
28) { \
29 { K00, K01, K02, K03 }, \
30 { K10, K11, K12, K13 }, \
31 { K20, K21, K22, K23 }, \
32 { K30, K31, K32, K33 }, \
33 { K40, K41, K42, K43 } \
34}
35
36#endif
diff --git a/keyboards/novelpad/readme.md b/keyboards/novelpad/readme.md
new file mode 100644
index 000000000..b743b9204
--- /dev/null
+++ b/keyboards/novelpad/readme.md
@@ -0,0 +1,15 @@
1# NovelPad/NumChoc
2
3![NovelPad](https://i.imgur.com/vi4EdSh.jpg?1)
4
5A 5x4 macropad/numpad, sold by NovelKeys.xyz. There are two versions of the PCB, the NovelPad for MX switches and the NumChoc for Kailh Choc low profile switches. Both utilize the same firmware with no changes required.
6
7Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click)
8Hardware Supported: NovelPad
9Hardware Availability: [Novelkeys.xyz](https://novelkeys.xyz)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make novelpad:default
14
15See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
diff --git a/keyboards/novelpad/rules.mk b/keyboards/novelpad/rules.mk
new file mode 100755
index 000000000..d90dd6265
--- /dev/null
+++ b/keyboards/novelpad/rules.mk
@@ -0,0 +1,56 @@
1# MCU name
2MCU = atmega32u2
3
4# Processor frequency.
5# This will define a symbol, F_CPU, in all source code files equal to the
6# processor frequency in Hz. You can then use this symbol in your source code to
7# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
8# automatically to create a 32-bit value in your source code.
9#
10# This will be an integer division of F_USB below, as it is sourced by
11# F_USB after it has run through any CPU prescalers. Note that this value
12# does not *change* the processor frequency - it should merely be updated to
13# reflect the processor speed set externally so that the code can use accurate
14# software delays.
15F_CPU = 16000000
16
17#
18# LUFA specific
19#
20# Target architecture (see library "Board Types" documentation).
21ARCH = AVR8
22
23# Input clock frequency.
24# This will define a symbol, F_USB, in all source code files equal to the
25# input clock frequency (before any prescaling is performed) in Hz. This value may
26# differ from F_CPU if prescaling is used on the latter, and is required as the
27# raw input clock is fed directly to the PLL sections of the AVR for high speed
28# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
29# at the end, this will be done automatically to create a 32-bit value in your
30# source code.
31#
32# If no clock division is performed on the input clock inside the AVR (via the
33# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
34F_USB = $(F_CPU)
35
36# Interrupt driven control endpoint task(+60)
37OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
38
39
40# Boot Section Size in *bytes*
41OPT_DEFS += -DBOOTLOADER_SIZE=4096
42
43
44# Build Options
45# comment out to disable the options.
46#
47BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
48MOUSEKEY_ENABLE = no # Mouse keys(+4700)
49EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
50CONSOLE_ENABLE = yes # Console for debug(+400)
51COMMAND_ENABLE = no # Commands for debug and configuration
52SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
53NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
54BACKLIGHT_ENABLE = yes # In-switch LEDs
55AUDIO_ENABLE = no # There is no available timer or pin for audio on the NovelPad
56RGBLIGHT_ENABLE = yes # RGB LEDs for underglow, installed and enabled by default for the NovelPad \ No newline at end of file