Skip to content

Commit d79b5e6

Browse files
john-pettigrewmechmerlin
authored andcommitted
Puck Macropad (#4274)
* Add Puck * Update Manufacturer name in metadata * Add num lock to high layer * update pins * update pin settings * fix numlock key * Cleanup config.h * Update device info * updates after review
1 parent 90f9fb4 commit d79b5e6

File tree

6 files changed

+190
-0
lines changed

6 files changed

+190
-0
lines changed

keyboards/puck/config.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#pragma once
2+
3+
#include "config_common.h"
4+
5+
/* USB Device descriptor parameter */
6+
#define VENDOR_ID 0xFEED
7+
#define PRODUCT_ID 0x6060
8+
#define DEVICE_VER 0x0001
9+
#define MANUFACTURER OkKeebs LLC
10+
#define PRODUCT Puck
11+
#define DESCRIPTION 4x3 macropad
12+
13+
/* key matrix size */
14+
#define MATRIX_ROWS 4
15+
#define MATRIX_COLS 3
16+
17+
#define MATRIX_ROW_PINS { D2, D3, C6, C7 }
18+
#define MATRIX_COL_PINS { B4, D7, D6 }
19+
#define UNUSED_PINS
20+
21+
/* COL2ROW or ROW2COL */
22+
#define DIODE_DIRECTION ROW2COL
23+
24+
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
25+
#define DEBOUNCING_DELAY 5
26+
27+
/* number of backlight levels */
28+
#define BACKLIGHT_LEVELS 3
29+
30+
/* Locking resynchronize hack */
31+
#define LOCKING_RESYNC_ENABLE
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#include QMK_KEYBOARD_H
2+
3+
#define _BL 0
4+
#define _HL 1
5+
#define _LL 2
6+
7+
enum keycodes {
8+
LOW,
9+
HIGH
10+
};
11+
12+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
13+
/*
14+
* Base Layer (Numbers)
15+
*/
16+
[_BL] = LAYOUT(
17+
KC_KP_7, KC_KP_8, KC_KP_9,
18+
KC_KP_4, KC_KP_5, KC_KP_6,
19+
KC_KP_1, KC_KP_2, KC_KP_3,
20+
LOW, KC_KP_0, HIGH
21+
),
22+
/*
23+
* High Layer (Work)
24+
*/
25+
[_HL] = LAYOUT(
26+
KC_NUMLOCK, KC_PAST, KC_NO,
27+
KC_PMNS, KC_PENT, KC_PPLS,
28+
KC_NO, KC_PSLS, KC_NO,
29+
KC_NO, KC_PDOT, KC_NO
30+
),
31+
/*
32+
* Low Layer (Media)
33+
*/
34+
[_LL] = LAYOUT(
35+
KC_NO, KC_VOLU, KC_NO,
36+
KC_MPRV, KC_MPLY, KC_MNXT,
37+
KC_NO, KC_VOLD, KC_NO,
38+
KC_NO, KC_NO, KC_NO
39+
),
40+
};
41+
42+
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
43+
switch(keycode) {
44+
case HIGH:
45+
if (record->event.pressed) {
46+
layer_on(_HL);
47+
}else{
48+
layer_off(_HL);
49+
layer_off(_LL);
50+
}
51+
return false;
52+
break;
53+
case LOW:
54+
if (record->event.pressed) {
55+
layer_on(_LL);
56+
}else{
57+
layer_off(_LL);
58+
layer_off(_HL);
59+
}
60+
return false;
61+
break;
62+
}
63+
return true;
64+
}

keyboards/puck/puck.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "puck.h"

keyboards/puck/puck.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#ifndef PUCK_H
2+
#define PUCK_H
3+
4+
#include "quantum.h"
5+
6+
#define LAYOUT( \
7+
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B \
8+
) { \
9+
{ K00, K01, K02 }, \
10+
{ K03, K04, K05 }, \
11+
{ K06, K07, K08 }, \
12+
{ K09, K0A, K0B }, \
13+
}
14+
15+
#endif

keyboards/puck/readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
A 4 x 3 macropad.
2+
3+
Keyboard Maintainer: [john-pettigrew](https://github.com/john-pettigrew)
4+
Hardware Supported: Puck PCB.
5+
Hardware Availability: [OkKeebs.com](https://okkeebs.com/products/puck-pcb)
6+
7+
Make example for this keyboard (after setting up your build environment):
8+
9+
make puck:default
10+
11+
See 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).

keyboards/puck/rules.mk

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
3+
# MCU name
4+
MCU = atmega32u4
5+
6+
# Processor frequency.
7+
# This will define a symbol, F_CPU, in all source code files equal to the
8+
# processor frequency in Hz. You can then use this symbol in your source code to
9+
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
10+
# automatically to create a 32-bit value in your source code.
11+
#
12+
# This will be an integer division of F_USB below, as it is sourced by
13+
# F_USB after it has run through any CPU prescalers. Note that this value
14+
# does not *change* the processor frequency - it should merely be updated to
15+
# reflect the processor speed set externally so that the code can use accurate
16+
# software delays.
17+
F_CPU = 16000000
18+
19+
#
20+
# LUFA specific
21+
#
22+
# Target architecture (see library "Board Types" documentation).
23+
ARCH = AVR8
24+
25+
# Input clock frequency.
26+
# This will define a symbol, F_USB, in all source code files equal to the
27+
# input clock frequency (before any prescaling is performed) in Hz. This value may
28+
# differ from F_CPU if prescaling is used on the latter, and is required as the
29+
# raw input clock is fed directly to the PLL sections of the AVR for high speed
30+
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
31+
# at the end, this will be done automatically to create a 32-bit value in your
32+
# source code.
33+
#
34+
# If no clock division is performed on the input clock inside the AVR (via the
35+
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
36+
F_USB = $(F_CPU)
37+
38+
# Interrupt driven control endpoint task(+60)
39+
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
40+
41+
42+
# Boot Section Size in *bytes*
43+
# Teensy halfKay 512
44+
# Teensy++ halfKay 1024
45+
# Atmel DFU loader 4096
46+
# LUFA bootloader 4096
47+
# USBaspLoader 2048
48+
BOOTLOADER = halfkay
49+
50+
# Build Options
51+
# change to "no" to disable the options, or define them in the Makefile in
52+
# the appropriate keymap folder that will get included automatically
53+
#
54+
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
55+
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
56+
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
57+
CONSOLE_ENABLE = no # Console for debug(+400)
58+
COMMAND_ENABLE = no # Commands for debug and configuration
59+
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
60+
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
61+
MIDI_ENABLE = no # MIDI controls
62+
AUDIO_ENABLE = no # Audio output on port C6
63+
UNICODE_ENABLE = no # Unicode
64+
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
65+
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
66+
67+
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
68+
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend

0 commit comments

Comments
 (0)