aboutsummaryrefslogtreecommitdiff
path: root/keyboards/crawlpad
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/crawlpad')
-rwxr-xr-xkeyboards/crawlpad/config.h45
-rwxr-xr-xkeyboards/crawlpad/crawlpad.c1
-rwxr-xr-xkeyboards/crawlpad/crawlpad.h16
-rw-r--r--keyboards/crawlpad/info.json27
-rwxr-xr-xkeyboards/crawlpad/keymaps/default/keymap.c78
-rw-r--r--keyboards/crawlpad/readme.md15
-rwxr-xr-xkeyboards/crawlpad/rules.mk20
7 files changed, 202 insertions, 0 deletions
diff --git a/keyboards/crawlpad/config.h b/keyboards/crawlpad/config.h
new file mode 100755
index 000000000..d923fe0c2
--- /dev/null
+++ b/keyboards/crawlpad/config.h
@@ -0,0 +1,45 @@
1#pragma once
2
3#include "config_common.h"
4
5/* USB Device descriptor parameter */
6#define VENDOR_ID 0xFEED
7#define PRODUCT_ID 0x6070
8#define DEVICE_VER 0x0001
9#define MANUFACTURER WoodKeys.click
10#define PRODUCT CrawlPad
11
12/* key matrix size */
13#define MATRIX_ROWS 4
14#define MATRIX_COLS 4
15
16/* key matrix pins */
17#define MATRIX_ROW_PINS { F0, F1, F4, F5 }
18#define MATRIX_COL_PINS { D4, D5, D6, D7 }
19#define UNUSED_PINS
20
21/* Pins for custom per-row LEDs. Should be changed to use named pins. */
22#define LED_ROW_PINS { 8, 9, 10, 11 }
23
24/* COL2ROW or ROW2COL */
25#define DIODE_DIRECTION ROW2COL
26
27/* Set 0 if debouncing isn't needed */
28#define DEBOUNCE 5
29
30/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
31#define LOCKING_SUPPORT_ENABLE
32
33/* Locking resynchronize hack */
34#define LOCKING_RESYNC_ENABLE
35
36/* key combination for command */
37#define IS_COMMAND() ( \
38 false \
39)
40
41#ifdef RGBLIGHT_ENABLE
42#define RGB_DI_PIN D3
43#define RGBLIGHT_ANIMATIONS
44#define RGBLED_NUM 3
45#endif
diff --git a/keyboards/crawlpad/crawlpad.c b/keyboards/crawlpad/crawlpad.c
new file mode 100755
index 000000000..d48f0a409
--- /dev/null
+++ b/keyboards/crawlpad/crawlpad.c
@@ -0,0 +1 @@
#include "crawlpad.h"
diff --git a/keyboards/crawlpad/crawlpad.h b/keyboards/crawlpad/crawlpad.h
new file mode 100755
index 000000000..572907c25
--- /dev/null
+++ b/keyboards/crawlpad/crawlpad.h
@@ -0,0 +1,16 @@
1#pragma once
2
3#include "quantum.h"
4
5#define LAYOUT_ortho_4x4( \
6 K00, K01, K02, K03, \
7 K10, K11, K12, K13, \
8 K20, K21, K22, K23, \
9 K30, K31, K32, K33 \
10) { \
11 { K00, K01, K02, K03 }, \
12 { K10, K11, K12, K13 }, \
13 { K20, K21, K22, K23 }, \
14 { K30, K31, K32, K33 } \
15}
16
diff --git a/keyboards/crawlpad/info.json b/keyboards/crawlpad/info.json
new file mode 100644
index 000000000..4613a4a5a
--- /dev/null
+++ b/keyboards/crawlpad/info.json
@@ -0,0 +1,27 @@
1{
2 "keyboard_name": "Crawlpad",
3 "url": "",
4 "maintainer": "colemarkham",
5 "layouts": {
6 "LAYOUT_ortho_4x4": {
7 "layout": [
8 {"label":"7", "x":0, "y":0},
9 {"label":"8", "x":1, "y":0},
10 {"label":"9", "x":2, "y":0},
11 {"label":"+", "x":3, "y":0},
12 {"label":"4", "x":0, "y":1},
13 {"label":"5", "x":1, "y":1},
14 {"label":"6", "x":2, "y":1},
15 {"label":"-", "x":3, "y":1},
16 {"label":"1", "x":0, "y":2},
17 {"label":"2", "x":1, "y":2},
18 {"label":"3", "x":2, "y":2},
19 {"label":"*", "x":3, "y":2},
20 {"label":"Fn", "x":0, "y":3},
21 {"label":"0", "x":1, "y":3},
22 {"label":".", "x":2, "y":3},
23 {"label":"Enter", "x":3, "y":3}
24 ]
25 }
26 }
27}
diff --git a/keyboards/crawlpad/keymaps/default/keymap.c b/keyboards/crawlpad/keymaps/default/keymap.c
new file mode 100755
index 000000000..c81bb56bd
--- /dev/null
+++ b/keyboards/crawlpad/keymaps/default/keymap.c
@@ -0,0 +1,78 @@
1#include QMK_KEYBOARD_H
2
3enum custom_keycodes {
4 BL1 = SAFE_RANGE,
5 BL2,
6 BL3,
7 BL4
8};
9
10const uint8_t LED_PINS[] = LED_ROW_PINS;
11
12const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
13
14 [0] = LAYOUT_ortho_4x4(
15 KC_P7, KC_P8, KC_P9, KC_PPLS,
16 KC_P4, KC_P5, KC_P6, KC_PMNS,
17 KC_P1, KC_P2, KC_P3, KC_PAST,
18 MO(1), KC_P0, KC_PDOT, KC_ENT
19 ),
20
21 [1] = LAYOUT_ortho_4x4(
22 KC_NLCK, BL1, KC_TRNS, KC_PSLS,
23 RESET, BL2, KC_TRNS, KC_TRNS,
24 KC_TRNS, BL3, KC_TRNS, KC_TRNS,
25 KC_TRNS, BL4, KC_TRNS, KC_TRNS
26 ),
27
28};
29
30void set_led(int idx, bool enable) {
31 uint8_t pin = LED_PINS[idx];
32 if (enable) {
33 _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);
34 } else {
35 /* PORTx &= ~n */
36 _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF);
37 }
38}
39
40bool process_record_user(uint16_t keycode, keyrecord_t *record) {
41 switch (keycode) {
42 case BL1:
43 if (record->event.pressed) {
44 PORTB |= (1 << 4);
45 } else {
46 PORTB &= ~(1 << 4);
47 }
48 return false;
49 case BL2:
50 if (record->event.pressed) {
51 PORTB |= (1 << 5);
52 } else {
53 PORTB &= ~(1 << 5);
54 }
55 return false;
56 case BL3:
57 if (record->event.pressed) {
58 PORTB |= (1 << 6);
59 } else {
60 PORTB &= ~(1 << 6);
61 }
62 return false;
63 case BL4:
64 if (record->event.pressed) {
65 PORTB |= (1 << 7);
66 } else {
67 PORTB &= ~(1 << 7);
68 }
69 return false;
70 }
71 return true;
72}
73
74void matrix_init_user(void) {
75 /* set LED row pins to output and low */
76 DDRB |= (1 << 4) | (1 << 5) | (1 << 6) | (1 << 7);
77 PORTB &= ~(1 << 4) & ~(1 << 5) & ~(1 << 6) & ~(1 << 7);
78}
diff --git a/keyboards/crawlpad/readme.md b/keyboards/crawlpad/readme.md
new file mode 100644
index 000000000..9eb01b7b6
--- /dev/null
+++ b/keyboards/crawlpad/readme.md
@@ -0,0 +1,15 @@
1# Crawlpad
2
3![Crawlpad](https://i.imgur.com/8BnztWo.jpg)
4
5A 4x4 macropad/numpad, exclusively availabe at Keycrawl events.
6
7Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham)
8Hardware Supported: Crawlpad
9Hardware Availability: Exclusive to Keycrawl events, contact [awwwwwwyeaahhhhhh](https://www.reddit.com/user/awwwwwwyeaahhhhhh) for more details.
10
11Make example for this keyboard (after setting up your build environment):
12
13 make crawlpad: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/crawlpad/rules.mk b/keyboards/crawlpad/rules.mk
new file mode 100755
index 000000000..d0d974ebd
--- /dev/null
+++ b/keyboards/crawlpad/rules.mk
@@ -0,0 +1,20 @@
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 = no # Enable Bootmagic Lite
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
15NKRO_ENABLE = yes # Enable N-Key Rollover
16BACKLIGHT_ENABLE = no # [Crawlpad] Custom backlighting code is used, so this should not be enabled
17AUDIO_ENABLE = no # [Crawlpad] This can be enabled if a speaker is connected to the expansion port. Not compatible with RGBLIGHT below
18RGBLIGHT_ENABLE = no # [Crawlpad] This can be enabled if a ws2812 strip is connected to the expansion port.
19
20LAYOUTS = ortho_4x4