aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElias <eliassjogreen1@gmail.com>2019-08-23 23:18:37 +0200
committernoroadsleft <18669334+noroadsleft@users.noreply.github.com>2019-08-23 14:18:37 -0700
commite0f91f37c4b944b328f9e022b18f2f1ad702fcf4 (patch)
treeb92f075e3b0aba0ebdc256c0e2c067025e384433
parentae44ec9820cdf5348e802c9bae3af34557617685 (diff)
downloadqmk_firmware-e0f91f37c4b944b328f9e022b18f2f1ad702fcf4.tar.gz
qmk_firmware-e0f91f37c4b944b328f9e022b18f2f1ad702fcf4.zip
Added 4by3 keyboard (#6547)
* Added 4by3 keyboard * Added DEVICE_VER and DESCRIPTION * Removed F_CPU, F_USB, ARCH, and OPT_DEFS * Add 3 new LAYOUT macros for orientations and fixes * Apply suggestions from code review Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> * Added comments to 4by3 and changed info.json * Update keyboards/4by3/4by3.h Co-Authored-By: fauxpark <fauxpark@gmail.com>
-rw-r--r--keyboards/4by3/4by3.c1
-rw-r--r--keyboards/4by3/4by3.h70
-rw-r--r--keyboards/4by3/config.h26
-rw-r--r--keyboards/4by3/info.json41
-rw-r--r--keyboards/4by3/keymaps/arrowpad/keymap.c12
-rw-r--r--keyboards/4by3/keymaps/default/keymap.c9
-rw-r--r--keyboards/4by3/keymaps/default/readme.md3
-rw-r--r--keyboards/4by3/keymaps/funcpad_horizontal/keymap.c9
-rw-r--r--keyboards/4by3/keymaps/funcpad_vertical/keymap.c12
-rw-r--r--keyboards/4by3/keymaps/numpad_horizontal/keymap.c9
-rw-r--r--keyboards/4by3/keymaps/numpad_vertical/keymap.c12
-rw-r--r--keyboards/4by3/readme.md15
-rw-r--r--keyboards/4by3/rules.mk8
13 files changed, 227 insertions, 0 deletions
diff --git a/keyboards/4by3/4by3.c b/keyboards/4by3/4by3.c
new file mode 100644
index 000000000..3ae27260d
--- /dev/null
+++ b/keyboards/4by3/4by3.c
@@ -0,0 +1 @@
#include "4by3.h" \ No newline at end of file
diff --git a/keyboards/4by3/4by3.h b/keyboards/4by3/4by3.h
new file mode 100644
index 000000000..b41628137
--- /dev/null
+++ b/keyboards/4by3/4by3.h
@@ -0,0 +1,70 @@
1#pragma once
2
3#include "quantum.h"
4
5/* LAYOUT_horizontal
6 * ┌───┐
7 * │USB│
8 * ├───┼───┬───┬───┐
9 * │K00│K01│K02│K03│
10 * ├───┼───┼───┼───┤
11 * │K10│K11│K12│K13│
12 * ├───┼───┼───┼───┤
13 * │K20│K21│K22│K23│
14 * └───┴───┴───┴───┘
15 */
16#define LAYOUT_horizontal( \
17 K00, K01, K02, K03, \
18 K10, K11, K12, K13, \
19 K20, K21, K22, K23 \
20) { \
21 { K00, K01, K02, K03 }, \
22 { K10, K11, K12, K13 }, \
23 { K20, K21, K22, K23 } \
24}
25
26/* LAYOUT_vertical_right
27 * ┌───┬───┬───┬───┐
28 * │K00│K01│K03│USB│
29 * ├───┼───┼───┬───┘
30 * │K04│K05│K06│
31 * ├───┼───┼───┤
32 * │K07│K08│K09│
33 * ├───┼───┼───┤
34 * │K10│K11│K12│
35 * └───┴───┴───┘
36 */
37#define LAYOUT_vertical_right( \
38 K20, K10, K00, \
39 K21, K11, K01, \
40 K22, K12, K02, \
41 K23, K13, K03 \
42) { \
43 { K00, K01, K02, K03 }, \
44 { K10, K11, K12, K13 }, \
45 { K20, K21, K22, K23 } \
46}
47
48/* LAYOUT_vertical_left
49 * ┌───┬───┬───┐
50 * │K00│K01│K03│
51 * ├───┼───┼───┤
52 * │K04│K05│K06│
53 * ├───┼───┼───┤
54 * │K07│K08│K09│
55 * ┌───┼───┼───┼───┤
56 * │USB│K10│K11│K12│
57 * └───┴───┴───┴───┘
58 */
59#define LAYOUT_vertical_left( \
60 K03, K13, K23, \
61 K02, K12, K22, \
62 K01, K11, K21, \
63 K00, K10, K20 \
64) { \
65 { K00, K01, K02, K03 }, \
66 { K10, K11, K12, K13 }, \
67 { K20, K21, K22, K23 } \
68}
69
70#define LAYOUT LAYOUT_horizontal
diff --git a/keyboards/4by3/config.h b/keyboards/4by3/config.h
new file mode 100644
index 000000000..2095ee42c
--- /dev/null
+++ b/keyboards/4by3/config.h
@@ -0,0 +1,26 @@
1#pragma once
2
3#include "config_common.h"
4
5/* USB Device descriptor parameter */
6#define VENDOR_ID 0xEEEE
7#define PRODUCT_ID 0x2019
8#define DEVICE_VER 0x0001
9#define MANUFACTURER Elias Sjögreen
10#define PRODUCT 4by3
11#define DESCRIPTION A small 12 key keypad
12
13/* key matrix size */
14#define MATRIX_ROWS 3
15#define MATRIX_COLS 4
16
17/* key matrix pins */
18#define MATRIX_ROW_PINS { D1, D0, D4 }
19#define MATRIX_COL_PINS { C6, D7, E6, B4 }
20#define UNUSED_PINS
21
22/* COL2ROW or ROW2COL */
23#define DIODE_DIRECTION COL2ROW
24
25/* Set 0 if debouncing isn't needed */
26#define DEBOUNCE 5
diff --git a/keyboards/4by3/info.json b/keyboards/4by3/info.json
new file mode 100644
index 000000000..9cc07a924
--- /dev/null
+++ b/keyboards/4by3/info.json
@@ -0,0 +1,41 @@
1{
2 "keyboard_name": "4by3",
3 "url": "https://github.com/eliassjogreen/4by3",
4 "maintainer": "eliassjogreen",
5 "width": 4,
6 "height": 3,
7 "layouts": {
8 "LAYOUT_horizontal": {
9 "key_count": 12,
10 "width": 4,
11 "height": 3,
12 "layout": [
13 { "x": 0, "y": 0 }, { "x": 1, "y": 0 }, { "x": 2, "y": 0 }, { "x": 3, "y": 0 },
14 { "x": 0, "y": 1 }, { "x": 1, "y": 1 }, { "x": 2, "y": 1 }, { "x": 3, "y": 1 },
15 { "x": 0, "y": 2 }, { "x": 1, "y": 2 }, { "x": 2, "y": 2 }, { "x": 3, "y": 2 }
16 ]
17 },
18 "LAYOUT_vertical_right": {
19 "key_count": 12,
20 "width": 3,
21 "height": 4,
22 "layout": [
23 { "x": 0, "y": 0 }, { "x": 1, "y": 0 }, { "x": 2, "y": 0 },
24 { "x": 0, "y": 1 }, { "x": 1, "y": 1 }, { "x": 2, "y": 1 },
25 { "x": 0, "y": 2 }, { "x": 1, "y": 2 }, { "x": 2, "y": 2 },
26 { "x": 0, "y": 3 }, { "x": 1, "y": 3 }, { "x": 2, "y": 3 }
27 ]
28 },
29 "LAYOUT_vertical_left": {
30 "key_count": 12,
31 "width": 3,
32 "height": 4,
33 "layout": [
34 { "x": 0, "y": 0 }, { "x": 1, "y": 0 }, { "x": 2, "y": 0 },
35 { "x": 0, "y": 1 }, { "x": 1, "y": 1 }, { "x": 2, "y": 1 },
36 { "x": 0, "y": 2 }, { "x": 1, "y": 2 }, { "x": 2, "y": 2 },
37 { "x": 0, "y": 3 }, { "x": 1, "y": 3 }, { "x": 2, "y": 3 }
38 ]
39 }
40 }
41}
diff --git a/keyboards/4by3/keymaps/arrowpad/keymap.c b/keyboards/4by3/keymaps/arrowpad/keymap.c
new file mode 100644
index 000000000..df803a35e
--- /dev/null
+++ b/keyboards/4by3/keymaps/arrowpad/keymap.c
@@ -0,0 +1,12 @@
1#include QMK_KEYBOARD_H
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 /* Change 'LAYOUT_vertical_right' to 'LAYOUT_vertical_left'
5 to change the side where the pro micro usb port is. */
6 [0] = LAYOUT_vertical_right(
7 KC_INS , KC_HOME , KC_PGUP ,
8 KC_DEL , KC_END , KC_PGDN ,
9 KC_PSCR , KC_UP , KC_PAUS ,
10 KC_LEFT , KC_DOWN , KC_RGHT
11 )
12};
diff --git a/keyboards/4by3/keymaps/default/keymap.c b/keyboards/4by3/keymaps/default/keymap.c
new file mode 100644
index 000000000..f348dc84f
--- /dev/null
+++ b/keyboards/4by3/keymaps/default/keymap.c
@@ -0,0 +1,9 @@
1#include QMK_KEYBOARD_H
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 [0] = LAYOUT_horizontal(
5 KC_VOLU , _______ , _______ , _______ ,
6 KC_MUTE , KC_MPRV , KC_MPLY , KC_MNXT ,
7 KC_VOLD , _______ , _______ , _______
8 )
9};
diff --git a/keyboards/4by3/keymaps/default/readme.md b/keyboards/4by3/keymaps/default/readme.md
new file mode 100644
index 000000000..281dfd546
--- /dev/null
+++ b/keyboards/4by3/keymaps/default/readme.md
@@ -0,0 +1,3 @@
1# The default 4by3 keymap
2
3![The default 4by3 keymap](https://i.imgur.com/E4OlQAs.png)
diff --git a/keyboards/4by3/keymaps/funcpad_horizontal/keymap.c b/keyboards/4by3/keymaps/funcpad_horizontal/keymap.c
new file mode 100644
index 000000000..287d125ef
--- /dev/null
+++ b/keyboards/4by3/keymaps/funcpad_horizontal/keymap.c
@@ -0,0 +1,9 @@
1#include QMK_KEYBOARD_H
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 [0] = LAYOUT_horizontal(
5 KC_F1 , KC_F2 , KC_F3 , KC_F4 ,
6 KC_F5 , KC_F6 , KC_F7 , KC_F8 ,
7 KC_F9 , KC_F10 , KC_F11 , KC_F12
8 )
9};
diff --git a/keyboards/4by3/keymaps/funcpad_vertical/keymap.c b/keyboards/4by3/keymaps/funcpad_vertical/keymap.c
new file mode 100644
index 000000000..c345f2824
--- /dev/null
+++ b/keyboards/4by3/keymaps/funcpad_vertical/keymap.c
@@ -0,0 +1,12 @@
1#include QMK_KEYBOARD_H
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 /* Change 'LAYOUT_vertical_right' to 'LAYOUT_vertical_left'
5 to change the side where the pro micro usb port is. */
6 [0] = LAYOUT_vertical_right(
7 KC_F1 , KC_F2 , KC_F3 ,
8 KC_F4 , KC_F5 , KC_F6 ,
9 KC_F7 , KC_F8 , KC_F9 ,
10 KC_F10 , KC_F11 , KC_F12
11 )
12};
diff --git a/keyboards/4by3/keymaps/numpad_horizontal/keymap.c b/keyboards/4by3/keymaps/numpad_horizontal/keymap.c
new file mode 100644
index 000000000..c1195b0bc
--- /dev/null
+++ b/keyboards/4by3/keymaps/numpad_horizontal/keymap.c
@@ -0,0 +1,9 @@
1#include QMK_KEYBOARD_H
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 [0] = LAYOUT_horizontal(
5 KC_P1 , KC_P2 , KC_P3 , KC_P4 ,
6 KC_P5 , KC_P6 , KC_P7 , KC_P8 ,
7 KC_P9 , KC_P0 , KC_BSPC , KC_ENT
8 ),
9};
diff --git a/keyboards/4by3/keymaps/numpad_vertical/keymap.c b/keyboards/4by3/keymaps/numpad_vertical/keymap.c
new file mode 100644
index 000000000..7705ea9b8
--- /dev/null
+++ b/keyboards/4by3/keymaps/numpad_vertical/keymap.c
@@ -0,0 +1,12 @@
1#include QMK_KEYBOARD_H
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 /* Change 'LAYOUT_vertical_right' to 'LAYOUT_vertical_left'
5 to change the side where the pro micro usb port is. */
6 [0] = LAYOUT_vertical_right(
7 KC_P1 , KC_P2 , KC_P3 ,
8 KC_P4 , KC_P5 , KC_P6 ,
9 KC_P7 , KC_P8 , KC_P9 ,
10 KC_BSPC , KC_P0 , KC_ENT
11 ),
12};
diff --git a/keyboards/4by3/readme.md b/keyboards/4by3/readme.md
new file mode 100644
index 000000000..0197c4ff8
--- /dev/null
+++ b/keyboards/4by3/readme.md
@@ -0,0 +1,15 @@
1# 4by3
2
3![4by3](https://i.imgur.com/Ykb7evL.jpg)
4
5A 12 key mechanical keypad.
6
7Keyboard Maintainer: [eliassjogreen](https://github.com/eliassjogreen)
8Hardware Supported: 4by3
9Hardware Availability: [eliassjogreen/4by3](https://github.com/eliassjogreen/4by3)
10
11Make example for this keyboard (after setting up your build environment):
12
13 make 4by3: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/4by3/rules.mk b/keyboards/4by3/rules.mk
new file mode 100644
index 000000000..7d2299833
--- /dev/null
+++ b/keyboards/4by3/rules.mk
@@ -0,0 +1,8 @@
1MCU = atmega32u4
2BOOTLOADER = caterina
3
4EXTRAKEY_ENABLE = yes
5NKRO_ENABLE = yes
6CONSOLE_ENABLE = yes
7COMMAND_ENABLE = yes
8