Add support for NovelPad/NumChoc by NovelKeys and Woodkeys

master
Cole Markham 2018-01-18 22:59:00 -06:00 committed by Jack Humbert
parent 4cfd1e30fc
commit e8082b5f9e
6 changed files with 319 additions and 0 deletions

68
keyboards/novelpad/config.h Executable file
View File

@ -0,0 +1,68 @@
/*
Copyright 2018 Cole Markham
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6070
#define DEVICE_VER 0x0001
#define MANUFACTURER NovelKeys.xyz
#define PRODUCT Novelpad
#define DESCRIPTION 5x4 Hotswap MX numpad
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 4
/* key matrix pins */
#define MATRIX_ROW_PINS { C2, C4, C5, C6, C7 }
#define MATRIX_COL_PINS { D7, D6, D5, D4 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* key combination for command */
#define IS_COMMAND() ( \
false \
)
/* prevent stuck modifiers */
#define PREVENT_STUCK_MODIFIERS
#define BACKLIGHT_LEVELS 10
#define BACKLIGHT_PIN B7
#ifdef RGBLIGHT_ENABLE
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 4
#endif
#endif

View File

@ -0,0 +1,127 @@
/*
Copyright 2018 Cole Markham
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
enum custom_keycodes {
BL = SAFE_RANGE,
WK_RED,
WK_GREEN,
WK_BLUE
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KEYMAP(
KC_NLCK, KC_PSLS, KC_PAST, KC_ESC,
KC_P7, KC_P8, KC_P9, KC_PMNS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_TAB,
MO(1), KC_P0, KC_PDOT, KC_ENT),
KEYMAP(
KC_TRNS, BL, RGB_MODE_SWIRL, RESET, \
RGB_TOG, RGB_MOD, RGB_MODE_PLAIN, RGB_MODE_SNAKE, \
RGB_HUI, RGB_SAI, RGB_VAI, RGB_MODE_KNIGHT, \
RGB_HUD , RGB_SAD, RGB_VAD, RGB_MODE_XMAS, \
KC_TRNS, WK_RED, WK_GREEN, WK_BLUE \
),
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
return MACRO_NONE ;
}
void matrix_init_user(void) {
rgblight_setrgb(0,255,0);
}
void matrix_scan_user(void) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case BL:
if (record->event.pressed) {
#ifdef BACKLIGHT_ENABLE
backlight_step();
#endif
}
return false;
break;
case WK_RED:
if (record->event.pressed) {
rgblight_show_solid_color(0xFF, 0, 0);
} else {
rgblight_show_solid_color(0xFF, 0xFF, 0xFF);
}
return false;
break;
case WK_GREEN:
if (record->event.pressed) {
rgblight_show_solid_color(0, 0xFF, 0);
} else {
rgblight_show_solid_color(0xFF, 0xFF, 0xFF);
}
return false;
break;
case WK_BLUE:
if (record->event.pressed) {
rgblight_show_solid_color(0, 0, 0xFF);
} else {
rgblight_show_solid_color(0xFF, 0xFF, 0xFF);
}
return false;
break;
}
return true;
}
void led_set_user(uint8_t usb_led) {
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
} else {
}
if (usb_led & (1 << USB_LED_COMPOSE)) {
} else {
}
if (usb_led & (1 << USB_LED_KANA)) {
} else {
}
}

17
keyboards/novelpad/novelpad.c Executable file
View File

@ -0,0 +1,17 @@
/*
Copyright 2018 Cole Markham
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "novelpad.h"

36
keyboards/novelpad/novelpad.h Executable file
View File

@ -0,0 +1,36 @@
/*
Copyright 2018 Cole Markham
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KB_H
#define KB_H
#include "quantum.h"
#define KEYMAP( \
K00, K01, K02, K03, \
K10, K11, K12, K13, \
K20, K21, K22, K23, \
K30, K31, K32, K33, \
K40, K41, K42, K43 \
) { \
{ K00, K01, K02, K03 }, \
{ K10, K11, K12, K13 }, \
{ K20, K21, K22, K23 }, \
{ K30, K31, K32, K33 }, \
{ K40, K41, K42, K43 } \
}
#endif

View File

@ -0,0 +1,15 @@
# NovelPad/NumChoc
![NovelPad](https://i.imgur.com/vi4EdSh.jpg?1)
A 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.
Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click)
Hardware Supported: NovelPad
Hardware Availability: [Novelkeys.xyz](https://novelkeys.xyz)
Make example for this keyboard (after setting up your build environment):
make novelpad:default
See [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.

56
keyboards/novelpad/rules.mk Executable file
View File

@ -0,0 +1,56 @@
# MCU name
MCU = atmega32u2
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # In-switch LEDs
AUDIO_ENABLE = no # There is no available timer or pin for audio on the NovelPad
RGBLIGHT_ENABLE = yes # RGB LEDs for underglow, installed and enabled by default for the NovelPad