aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dias <matthewdias@me.com>2021-03-17 01:31:58 -0500
committerGitHub <noreply@github.com>2021-03-16 23:31:58 -0700
commit163e9b02bfbe1618c00f4b7110d9b7f68c332b41 (patch)
tree2d2c27fb662234d2f156942cff86de972121d3c2
parent90f95de5c992e695fa73ebf11116f6ea322815de (diff)
downloadqmk_firmware-163e9b02bfbe1618c00f4b7110d9b7f68c332b41.tar.gz
qmk_firmware-163e9b02bfbe1618c00f4b7110d9b7f68c332b41.zip
[Keyboard] Add barleycorn smd keyboard (#12200)
-rw-r--r--keyboards/barleycorn_smd/barleycorn_smd.c16
-rw-r--r--keyboards/barleycorn_smd/barleycorn_smd.h63
-rw-r--r--keyboards/barleycorn_smd/config.h111
-rw-r--r--keyboards/barleycorn_smd/info.json283
-rw-r--r--keyboards/barleycorn_smd/keymaps/default/keymap.c34
-rw-r--r--keyboards/barleycorn_smd/keymaps/default/readme.md11
-rw-r--r--keyboards/barleycorn_smd/keymaps/iso/keymap.c34
-rw-r--r--keyboards/barleycorn_smd/keymaps/iso/readme.md11
-rw-r--r--keyboards/barleycorn_smd/keymaps/via/keymap.c48
-rw-r--r--keyboards/barleycorn_smd/keymaps/via/readme.md1
-rw-r--r--keyboards/barleycorn_smd/keymaps/via/rules.mk1
-rw-r--r--keyboards/barleycorn_smd/matrix.c138
-rw-r--r--keyboards/barleycorn_smd/readme.md19
-rw-r--r--keyboards/barleycorn_smd/rules.mk27
14 files changed, 797 insertions, 0 deletions
diff --git a/keyboards/barleycorn_smd/barleycorn_smd.c b/keyboards/barleycorn_smd/barleycorn_smd.c
new file mode 100644
index 000000000..d70689d8f
--- /dev/null
+++ b/keyboards/barleycorn_smd/barleycorn_smd.c
@@ -0,0 +1,16 @@
1/* Copyright 2021 Matthew Dias
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "barleycorn_smd.h"
diff --git a/keyboards/barleycorn_smd/barleycorn_smd.h b/keyboards/barleycorn_smd/barleycorn_smd.h
new file mode 100644
index 000000000..926b67b37
--- /dev/null
+++ b/keyboards/barleycorn_smd/barleycorn_smd.h
@@ -0,0 +1,63 @@
1/* Copyright 2021 Matthew Dias
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#define XXX KC_NO
20
21#include "quantum.h"
22
23#define LAYOUT_all( \
24 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, K0E, K0F, K0G, K0H, \
25 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, K1E, K1F, K1G, K1H, \
26 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, K2F, K2G, K2H, \
27 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, \
28 K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H \
29) { \
30 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H }, \
31 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H }, \
32 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H }, \
33 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H }, \
34 { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H } \
35}
36
37#define LAYOUT_ansi( \
38 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, K0E, K0F, K0G, K0H, \
39 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, K1E, K1F, K1G, K1H, \
40 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2E, K2F, K2G, K2H, \
41 K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, \
42 K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H \
43) { \
44 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H }, \
45 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H }, \
46 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H }, \
47 { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H }, \
48 { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H } \
49}
50
51#define LAYOUT_iso( \
52 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, K0E, K0F, K0G, K0H, \
53 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, K1G, K1H, \
54 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, \
55 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, \
56 K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H \
57) { \
58 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H }, \
59 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H }, \
60 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H }, \
61 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H }, \
62 { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H } \
63}
diff --git a/keyboards/barleycorn_smd/config.h b/keyboards/barleycorn_smd/config.h
new file mode 100644
index 000000000..2ac86bf8a
--- /dev/null
+++ b/keyboards/barleycorn_smd/config.h
@@ -0,0 +1,111 @@
1/*
2Copyright 2021 Matthew Dias
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
18#pragma once
19
20#include "config_common.h"
21
22#define VENDOR_ID 0x7033
23#define PRODUCT_ID 0x4749
24#define DEVICE_VER 0x0001
25#define MANUFACTURER P3D Store
26#define PRODUCT Barleycorn SMD
27
28/* key matrix size */
29#define MATRIX_ROWS 5
30#define MATRIX_COLS 18
31
32/*
33 * Keyboard Matrix Assignments
34 *
35 * Change this to how you wired your keyboard
36 * COLS: AVR pins used for columns, left to right
37 * ROWS: AVR pins used for rows, top to bottom
38 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
39 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
40 *
41 */
42
43/* A Custom matrix.c is used to poll the port expander C6 shows that the pins are hardwired there */
44#define MATRIX_ROW_PINS { F5, F4, F1, F0, F6 }
45#define MATRIX_COL_PINS { D4, D6, D7, B4, B5, B6, C6, C7, D5, D5, D5, D5, D5, D5, D5, D5, D5, D5 }
46#define UNUSED_PINS
47#define PORT_EXPANDER_ADDRESS 0x20
48
49#define RGB_DI_PIN E6
50#define RGBLED_NUM 15
51#define RGBLIGHT_ANIMATIONS
52#define RGBLIGHT_LED_MAP { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 5 }
53
54#define LED_CAPS_LOCK_PIN B2
55#define LED_NUM_LOCK_PIN B3
56
57/* COL2ROW, ROW2COL*/
58#define DIODE_DIRECTION COL2ROW
59
60#define USB_MAX_POWER_CONSUMPTION 400
61
62
63/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
64#define LOCKING_SUPPORT_ENABLE
65/* Locking resynchronize hack */
66#define LOCKING_RESYNC_ENABLE
67
68/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
69 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
70 */
71// #define GRAVE_ESC_CTRL_OVERRIDE
72
73/*
74 * Force NKRO
75 *
76 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
77 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
78 * makefile for this to work.)
79 *
80 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
81 * until the next keyboard reset.
82 *
83 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
84 * fully operational during normal computer usage.
85 *
86 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
87 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
88 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
89 * power-up.
90 *
91 */
92//#define FORCE_NKRO
93
94
95/*
96 * Feature disable options
97 * These options are also useful to firmware size reduction.
98 */
99
100/* disable debug print */
101//#define NO_DEBUG
102
103/* disable print */
104//#define NO_PRINT
105
106/* disable action features */
107//#define NO_ACTION_LAYER
108//#define NO_ACTION_TAPPING
109//#define NO_ACTION_ONESHOT
110//#define NO_ACTION_MACRO
111//#define NO_ACTION_FUNCTION
diff --git a/keyboards/barleycorn_smd/info.json b/keyboards/barleycorn_smd/info.json
new file mode 100644
index 000000000..c33f77a9b
--- /dev/null
+++ b/keyboards/barleycorn_smd/info.json
@@ -0,0 +1,283 @@
1{
2 "keyboard_name": "Barleycorn SMD",
3 "maintainer": "matthewdias",
4 "width": 19.5,
5 "height": 5,
6 "layouts": {
7 "LAYOUT_all": {
8 "layout": [
9 { "label": "0,0", "x": 0, "y": 0 },
10 { "label": "0,1", "x": 1, "y": 0 },
11 { "label": "0,2", "x": 2, "y": 0 },
12 { "label": "0,3", "x": 3, "y": 0 },
13 { "label": "0,4", "x": 4, "y": 0 },
14 { "label": "0,5", "x": 5, "y": 0 },
15 { "label": "0,6", "x": 6, "y": 0 },
16 { "label": "0,7", "x": 7, "y": 0 },
17 { "label": "0,8", "x": 8, "y": 0 },
18 { "label": "0,9", "x": 9, "y": 0 },
19 { "label": "0,10", "x": 10, "y": 0 },
20 { "label": "0,11", "x": 11, "y": 0 },
21 { "label": "0,12", "x": 12, "y": 0 },
22 { "label": "0,13", "x": 13, "y": 0 },
23 { "label": "1,13", "x": 14, "y": 0 },
24 { "label": "0,14", "x": 15.5, "y": 0 },
25 { "label": "0,15", "x": 16.5, "y": 0 },
26 { "label": "0,16", "x": 17.5, "y": 0 },
27 { "label": "0,17", "x": 18.5, "y": 0 },
28
29 { "label": "1,0", "x": 0, "y": 1, "w": 1.5 },
30 { "label": "1,1", "x": 1.5, "y": 1 },
31 { "label": "1,2", "x": 2.5, "y": 1 },
32 { "label": "1,3", "x": 3.5, "y": 1 },
33 { "label": "1,4", "x": 4.5, "y": 1 },
34 { "label": "1,5", "x": 5.5, "y": 1 },
35 { "label": "1,6", "x": 6.5, "y": 1 },
36 { "label": "1,7", "x": 7.5, "y": 1 },
37 { "label": "1,8", "x": 8.5, "y": 1 },
38 { "label": "1,9", "x": 9.5, "y": 1 },
39 { "label": "1,10", "x": 10.5, "y": 1 },
40 { "label": "1,11", "x": 11.5, "y": 1 },
41 { "label": "1,12", "x": 12.5, "y": 1 },
42 { "label": "2,12", "x": 13.5, "y": 1, "w": 1.5 },
43 { "label": "1,14", "x": 15.5, "y": 1 },
44 { "label": "1,15", "x": 16.5, "y": 1 },
45 { "label": "1,16", "x": 17.5, "y": 1 },
46 { "label": "1,17", "x": 18.5, "y": 1 },
47
48 { "label": "2,0", "x": 0, "y": 2, "w": 1.75 },
49 { "label": "2,1", "x": 1.75, "y": 2 },
50 { "label": "2,2", "x": 2.75, "y": 2 },
51 { "label": "2,3", "x": 3.75, "y": 2 },
52 { "label": "2,4", "x": 4.75, "y": 2 },
53 { "label": "2,5", "x": 5.75, "y": 2 },
54 { "label": "2,6", "x": 6.75, "y": 2 },
55 { "label": "2,7", "x": 7.75, "y": 2 },
56 { "label": "2,8", "x": 8.75, "y": 2 },
57 { "label": "2,9", "x": 9.75, "y": 2 },
58 { "label": "2,10", "x": 10.75, "y": 2 },
59 { "label": "2,11", "x": 11.75, "y": 2 },
60 { "label": "2,13", "x": 12.75, "y": 2, "w": 2.25 },
61 { "label": "2,14", "x": 15.5, "y": 2 },
62 { "label": "2,15", "x": 16.5, "y": 2 },
63 { "label": "2,16", "x": 17.5, "y": 2 },
64 { "label": "2,17", "x": 18.5, "y": 2 },
65
66 { "label": "3,0", "x": 0, "y": 3, "w": 1.25 },
67 { "label": "3,1", "x": 1.25, "y": 3 },
68 { "label": "3,2", "x": 2.25, "y": 3 },
69 { "label": "3,3", "x": 3.25, "y": 3 },
70 { "label": "3,4", "x": 4.25, "y": 3 },
71 { "label": "3,5", "x": 5.25, "y": 3 },
72 { "label": "3,6", "x": 6.25, "y": 3 },
73 { "label": "3,7", "x": 7.25, "y": 3 },
74 { "label": "3,8", "x": 8.25, "y": 3 },
75 { "label": "3,9", "x": 9.25, "y": 3 },
76 { "label": "3,10", "x": 10.25, "y": 3 },
77 { "label": "3,11", "x": 11.25, "y": 3 },
78 { "label": "3,12", "x": 12.25, "y": 3, "w": 1.75 },
79 { "label": "3,13", "x": 14.25, "y": 3.25 },
80 { "label": "3,14", "x": 15.5, "y": 3 },
81 { "label": "3,15", "x": 16.5, "y": 3 },
82 { "label": "3,16", "x": 17.5, "y": 3 },
83 { "label": "3,17", "x": 18.5, "y": 3 },
84
85 { "label": "4,0", "x": 0, "y": 4, "w": 1.25 },
86 { "label": "4,1", "x": 1.25, "y": 4, "w": 1.25 },
87 { "label": "4,2", "x": 2.5, "y": 4, "w": 1.25 },
88 { "label": "4,6", "x": 3.75, "y": 4, "w": 6.25 },
89 { "label": "4,10", "x": 10, "y": 4, "w": 1.5 },
90 { "label": "4,11", "x": 11.5, "y": 4, "w": 1.5 },
91 { "label": "4,12", "x": 13.25, "y": 4.25 },
92 { "label": "4,13", "x": 14.25, "y": 4.25 },
93 { "label": "4,14", "x": 15.25, "y": 4.25 },
94 { "label": "4,15", "x": 16.5, "y": 4 },
95 { "label": "4,16", "x": 17.5, "y": 4 },
96 { "label": "4,17", "x": 18.5, "y": 4 }
97 ]
98 },
99 "LAYOUT_ansi": {
100 "layout": [
101 { "label": "0,0", "x": 0, "y": 0 },
102 { "label": "0,1", "x": 1, "y": 0 },
103 { "label": "0,2", "x": 2, "y": 0 },
104 { "label": "0,3", "x": 3, "y": 0 },
105 { "label": "0,4", "x": 4, "y": 0 },
106 { "label": "0,5", "x": 5, "y": 0 },
107 { "label": "0,6", "x": 6, "y": 0 },
108 { "label": "0,7", "x": 7, "y": 0 },
109 { "label": "0,8", "x": 8, "y": 0 },
110 { "label": "0,9", "x": 9, "y": 0 },
111 { "label": "0,10", "x": 10, "y": 0 },
112 { "label": "0,11", "x": 11, "y": 0 },
113 { "label": "0,12", "x": 12, "y": 0 },
114 { "label": "0,13", "x": 13, "y": 0 },
115 { "label": "1,13", "x": 14, "y": 0 },
116 { "label": "0,14", "x": 15.5, "y": 0 },
117 { "label": "0,15", "x": 16.5, "y": 0 },
118 { "label": "0,16", "x": 17.5, "y": 0 },
119 { "label": "0,17", "x": 18.5, "y": 0 },
120
121 { "label": "1,0", "x": 0, "y": 1, "w": 1.5 },
122 { "label": "1,1", "x": 1.5, "y": 1 },
123 { "label": "1,2", "x": 2.5, "y": 1 },
124 { "label": "1,3", "x": 3.5, "y": 1 },
125 { "label": "1,4", "x": 4.5, "y": 1 },
126 { "label": "1,5", "x": 5.5, "y": 1 },
127 { "label": "1,6", "x": 6.5, "y": 1 },
128 { "label": "1,7", "x": 7.5, "y": 1 },
129 { "label": "1,8", "x": 8.5, "y": 1 },
130 { "label": "1,9", "x": 9.5, "y": 1 },
131 { "label": "1,10", "x": 10.5, "y": 1 },
132 { "label": "1,11", "x": 11.5, "y": 1 },
133 { "label": "1,12", "x": 12.5, "y": 1 },
134 { "label": "2,12", "x": 13.5, "y": 1, "w": 1.5 },
135 { "label": "1,14", "x": 15.5, "y": 1 },
136 { "label": "1,15", "x": 16.5, "y": 1 },
137 { "label": "1,16", "x": 17.5, "y": 1 },
138 { "label": "1,17", "x": 18.5, "y": 1 },
139
140 { "label": "2,0", "x": 0, "y": 2, "w": 1.75 },
141 { "label": "2,1", "x": 1.75, "y": 2 },
142 { "label": "2,2", "x": 2.75, "y": 2 },
143 { "label": "2,3", "x": 3.75, "y": 2 },
144 { "label": "2,4", "x": 4.75, "y": 2 },
145 { "label": "2,5", "x": 5.75, "y": 2 },
146 { "label": "2,6", "x": 6.75, "y": 2 },
147 { "label": "2,7", "x": 7.75, "y": 2 },
148 { "label": "2,8", "x": 8.75, "y": 2 },
149 { "label": "2,9", "x": 9.75, "y": 2 },
150 { "label": "2,10", "x": 10.75, "y": 2 },
151 { "label": "2,11", "x": 11.75, "y": 2 },
152 { "label": "2,13", "x": 12.75, "y": 2, "w": 2.25 },
153 { "label": "2,14", "x": 15.5, "y": 2 },
154 { "label": "2,15", "x": 16.5, "y": 2 },
155 { "label": "2,16", "x": 17.5, "y": 2 },
156 { "label": "2,17", "x": 18.5, "y": 2 },
157
158 { "label": "3,0", "x": 0, "y": 3, "w": 2.25 },
159 { "label": "3,2", "x": 2.25, "y": 3 },
160 { "label": "3,3", "x": 3.25, "y": 3 },
161 { "label": "3,4", "x": 4.25, "y": 3 },
162 { "label": "3,5", "x": 5.25, "y": 3 },
163 { "label": "3,6", "x": 6.25, "y": 3 },
164 { "label": "3,7", "x": 7.25, "y": 3 },
165 { "label": "3,8", "x": 8.25, "y": 3 },
166 { "label": "3,9", "x": 9.25, "y": 3 },
167 { "label": "3,10", "x": 10.25, "y": 3 },
168 { "label": "3,11", "x": 11.25, "y": 3 },
169 { "label": "3,12", "x": 12.25, "y": 3, "w": 1.75 },
170 { "label": "3,13", "x": 14.25, "y": 3.25 },
171 { "label": "3,14", "x": 15.5, "y": 3 },
172 { "label": "3,15", "x": 16.5, "y": 3 },
173 { "label": "3,16", "x": 17.5, "y": 3 },
174 { "label": "3,17", "x": 18.5, "y": 3 },
175
176 { "label": "4,0", "x": 0, "y": 4, "w": 1.25 },
177 { "label": "4,1", "x": 1.25, "y": 4, "w": 1.25 },
178 { "label": "4,2", "x": 2.5, "y": 4, "w": 1.25 },
179 { "label": "4,6", "x": 3.75, "y": 4, "w": 6.25 },
180 { "label": "4,10", "x": 10, "y": 4, "w": 1.5 },
181 { "label": "4,11", "x": 11.5, "y": 4, "w": 1.5 },
182 { "label": "4,12", "x": 13.25, "y": 4.25 },
183 { "label": "4,13", "x": 14.25, "y": 4.25 },
184 { "label": "4,14", "x": 15.25, "y": 4.25 },
185 { "label": "4,15", "x": 16.5, "y": 4 },
186 { "label": "4,16", "x": 17.5, "y": 4 },
187 { "label": "4,17", "x": 18.5, "y": 4 }
188 ]
189 },
190 "LAYOUT_iso": {
191 "layout": [
192 { "label": "0,0", "x": 0, "y": 0 },
193 { "label": "0,1", "x": 1, "y": 0 },
194 { "label": "0,2", "x": 2, "y": 0 },
195 { "label": "0,3", "x": 3, "y": 0 },
196 { "label": "0,4", "x": 4, "y": 0 },
197 { "label": "0,5", "x": 5, "y": 0 },
198 { "label": "0,6", "x": 6, "y": 0 },
199 { "label": "0,7", "x": 7, "y": 0 },
200 { "label": "0,8", "x": 8, "y": 0 },
201 { "label": "0,9", "x": 9, "y": 0 },
202 { "label": "0,10", "x": 10, "y": 0 },
203 { "label": "0,11", "x": 11, "y": 0 },
204 { "label": "0,12", "x": 12, "y": 0 },
205 { "label": "0,13", "x": 13, "y": 0 },
206 { "label": "1,13", "x": 14, "y": 0 },
207 { "label": "0,14", "x": 15.5, "y": 0 },
208 { "label": "0,15", "x": 16.5, "y": 0 },
209 { "label": "0,16", "x": 17.5, "y": 0 },
210 { "label": "0,17", "x": 18.5, "y": 0 },
211
212 { "label": "1,0", "x": 0, "y": 1, "w": 1.5 },
213 { "label": "1,1", "x": 1.5, "y": 1 },
214 { "label": "1,2", "x": 2.5, "y": 1 },
215 { "label": "1,3", "x": 3.5, "y": 1 },
216 { "label": "1,4", "x": 4.5, "y": 1 },
217 { "label": "1,5", "x": 5.5, "y": 1 },
218 { "label": "1,6", "x": 6.5, "y": 1 },
219 { "label": "1,7", "x": 7.5, "y": 1 },
220 { "label": "1,8", "x": 8.5, "y": 1 },
221 { "label": "1,9", "x": 9.5, "y": 1 },
222 { "label": "1,10", "x": 10.5, "y": 1 },
223 { "label": "1,11", "x": 11.5, "y": 1 },
224 { "label": "1,12", "x": 12.5, "y": 1 },
225 { "label": "1,14", "x": 15.5, "y": 1 },
226 { "label": "1,15", "x": 16.5, "y": 1 },
227 { "label": "1,16", "x": 17.5, "y": 1 },
228 { "label": "1,17", "x": 18.5, "y": 1 },
229
230 { "label": "2,0", "x": 0, "y": 2, "w": 1.75 },
231 { "label": "2,1", "x": 1.75, "y": 2 },
232 { "label": "2,2", "x": 2.75, "y": 2 },
233 { "label": "2,3", "x": 3.75, "y": 2 },
234 { "label": "2,4", "x": 4.75, "y": 2 },
235 { "label": "2,5", "x": 5.75, "y": 2 },
236 { "label": "2,6", "x": 6.75, "y": 2 },
237 { "label": "2,7", "x": 7.75, "y": 2 },
238 { "label": "2,8", "x": 8.75, "y": 2 },
239 { "label": "2,9", "x": 9.75, "y": 2 },
240 { "label": "2,10", "x": 10.75, "y": 2 },
241 { "label": "2,11", "x": 11.75, "y": 2 },
242 { "label": "2,12", "x": 12.75, "y": 2 },
243 { "label": "2,13", "x": 13.75, "y": 1, "w": 1.25, "h": 2 },
244 { "label": "2,14", "x": 15.5, "y": 2 },
245 { "label": "2,15", "x": 16.5, "y": 2 },
246 { "label": "2,16", "x": 17.5, "y": 2 },
247 { "label": "2,17", "x": 18.5, "y": 2 },
248
249 { "label": "3,0", "x": 0, "y": 3, "w": 1.25 },
250 { "label": "3,1", "x": 1.25, "y": 3 },
251 { "label": "3,2", "x": 2.25, "y": 3 },
252 { "label": "3,3", "x": 3.25, "y": 3 },
253 { "label": "3,4", "x": 4.25, "y": 3 },
254 { "label": "3,5", "x": 5.25, "y": 3 },
255 { "label": "3,6", "x": 6.25, "y": 3 },
256 { "label": "3,7", "x": 7.25, "y": 3 },
257 { "label": "3,8", "x": 8.25, "y": 3 },
258 { "label": "3,9", "x": 9.25, "y": 3 },
259 { "label": "3,10", "x": 10.25, "y": 3 },
260 { "label": "3,11", "x": 11.25, "y": 3 },
261 { "label": "3,12", "x": 12.25, "y": 3, "w": 1.75 },
262 { "label": "3,13", "x": 14.25, "y": 3.25 },
263 { "label": "3,14", "x": 15.5, "y": 3 },
264 { "label": "3,15", "x": 16.5, "y": 3 },
265 { "label": "3,16", "x": 17.5, "y": 3 },
266 { "label": "3,17", "x": 18.5, "y": 3 },
267
268 { "label": "4,0", "x": 0, "y": 4, "w": 1.25 },
269 { "label": "4,1", "x": 1.25, "y": 4, "w": 1.25 },
270 { "label": "4,2", "x": 2.5, "y": 4, "w": 1.25 },
271 { "label": "4,6", "x": 3.75, "y": 4, "w": 6.25 },
272 { "label": "4,10", "x": 10, "y": 4, "w": 1.5 },
273 { "label": "4,11", "x": 11.5, "y": 4, "w": 1.5 },
274 { "label": "4,12", "x": 13.25, "y": 4.25 },
275 { "label": "4,13", "x": 14.25, "y": 4.25 },
276 { "label": "4,14", "x": 15.25, "y": 4.25 },
277 { "label": "4,15", "x": 16.5, "y": 4 },
278 { "label": "4,16", "x": 17.5, "y": 4 },
279 { "label": "4,17", "x": 18.5, "y": 4 }
280 ]
281 }
282 }
283}
diff --git a/keyboards/barleycorn_smd/keymaps/default/keymap.c b/keyboards/barleycorn_smd/keymaps/default/keymap.c
new file mode 100644
index 000000000..8bfc60ad4
--- /dev/null
+++ b/keyboards/barleycorn_smd/keymaps/default/keymap.c
@@ -0,0 +1,34 @@
1/* Copyright 2021 Matthew Dias
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18//This is the ANSI version of the PCB
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21[0] = LAYOUT_ansi( /* Base */
22 KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
23 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PEQL,
24 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
25 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_BSPC,
26 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT),
27
28[1] = LAYOUT_ansi( /* FN */
29 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
31 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
32 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
33 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
34};
diff --git a/keyboards/barleycorn_smd/keymaps/default/readme.md b/keyboards/barleycorn_smd/keymaps/default/readme.md
new file mode 100644
index 000000000..04903f8cc
--- /dev/null
+++ b/keyboards/barleycorn_smd/keymaps/default/readme.md
@@ -0,0 +1,11 @@
1# The default keymap for Barleycorn
2
3![Layer 0](https://i.imgur.com/cU9lzz3.png)
4
5![Layer 1](https://i.imgur.com/0G3e1K3.png)
6
7Default layer is normal ANSI and Fn layer is used for Volume control and arrow cluster.
8
9Alternative ANSI layouts:
10
11![Alt Keymap](https://i.imgur.com/6uAx8jZ.png)
diff --git a/keyboards/barleycorn_smd/keymaps/iso/keymap.c b/keyboards/barleycorn_smd/keymaps/iso/keymap.c
new file mode 100644
index 000000000..0f739c883
--- /dev/null
+++ b/keyboards/barleycorn_smd/keymaps/iso/keymap.c
@@ -0,0 +1,34 @@
1/* Copyright 2021 Matthew Dias
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18//This is the ISO version of the PCB
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21[0] = LAYOUT_iso( /* Base */
22 KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
23 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, KC_PEQL,
24 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
25 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_BSPC,
26 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT),
27
28[1] = LAYOUT_iso( /* FN */
29 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
31 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
32 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
33 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
34};
diff --git a/keyboards/barleycorn_smd/keymaps/iso/readme.md b/keyboards/barleycorn_smd/keymaps/iso/readme.md
new file mode 100644
index 000000000..492abfcec
--- /dev/null
+++ b/keyboards/barleycorn_smd/keymaps/iso/readme.md
@@ -0,0 +1,11 @@
1# The default keymap for ISO Barleycorn
2
3![Layer 0](https://i.imgur.com/llZlVHt.png)
4
5![Layer 1](https://i.imgur.com/hrYtMQk.png)
6
7Default layer is normal ISO and Fn layer is used for Volume control and arrow cluster
8
9Alternative ISO layouts:
10
11![Alt Keymap](https://i.imgur.com/2cL0IGQ.png)
diff --git a/keyboards/barleycorn_smd/keymaps/via/keymap.c b/keyboards/barleycorn_smd/keymaps/via/keymap.c
new file mode 100644
index 000000000..4cc2f1a73
--- /dev/null
+++ b/keyboards/barleycorn_smd/keymaps/via/keymap.c
@@ -0,0 +1,48 @@
1/* Copyright 2021 Matthew Dias
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18// This keymaps is used for VIA, it reflects the default keymap.
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21[0] = LAYOUT_all( /* Base */
22 KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
23 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PEQL,
24 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS,
25 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_BSPC,
26 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT),
27
28[1] = LAYOUT_all( /* FN */
29 KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30 KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
31 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
32 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
33 KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
34
35[2] = LAYOUT_all( /* Empty for dynamic keymaps */
36 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
37 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
38 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
39 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
41
42[3] = LAYOUT_all( /* Empty for dynamic keymaps */
43 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
44 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
46 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
47 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
48};
diff --git a/keyboards/barleycorn_smd/keymaps/via/readme.md b/keyboards/barleycorn_smd/keymaps/via/readme.md
new file mode 100644
index 000000000..b82bc8e79
--- /dev/null
+++ b/keyboards/barleycorn_smd/keymaps/via/readme.md
@@ -0,0 +1 @@
# Compile with this keymap to use VIA
diff --git a/keyboards/barleycorn_smd/keymaps/via/rules.mk b/keyboards/barleycorn_smd/keymaps/via/rules.mk
new file mode 100644
index 000000000..1e5b99807
--- /dev/null
+++ b/keyboards/barleycorn_smd/keymaps/via/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes
diff --git a/keyboards/barleycorn_smd/matrix.c b/keyboards/barleycorn_smd/matrix.c
new file mode 100644
index 000000000..b717452f3
--- /dev/null
+++ b/keyboards/barleycorn_smd/matrix.c
@@ -0,0 +1,138 @@
1/*
2Copyright 2021 Matthew Dias
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 <stdint.h>
18#include <stdbool.h>
19#include "wait.h"
20#include "quantum.h"
21#include "i2c_master.h"
22
23static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
24static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
25
26static void unselect_rows(void) {
27 for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
28 setPinInputHigh(row_pins[x]);
29 }
30}
31
32static void select_row(uint8_t row) {
33 setPinOutput(row_pins[row]);
34 writePinLow(row_pins[row]);
35}
36
37static void unselect_row(uint8_t row) {
38 setPinInputHigh(row_pins[row]);
39}
40
41static void init_pins(void) {
42 unselect_rows();
43 // Set I/O
44 uint8_t send_data[2] = { 0xFF, 0x03};
45 i2c_writeReg((PORT_EXPANDER_ADDRESS << 1), 0x00, &send_data[0], 2, 20);
46 // Set Pull-up
47 i2c_writeReg((PORT_EXPANDER_ADDRESS << 1), 0x0C, &send_data[0], 2, 20);
48
49 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
50 if ( x < 8 ) {
51 setPinInputHigh(col_pins[x]);
52 }
53 }
54}
55
56void matrix_init_custom(void) {
57 // TODO: initialize hardware here
58 // Initialize I2C
59 i2c_init();
60
61 // initialize key pins
62 init_pins();
63 wait_ms(50);
64}
65
66static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
67 // Store last value of row prior to reading
68 matrix_row_t last_row_value = current_matrix[current_row];
69
70 // Clear data in matrix row
71 current_matrix[current_row] = 0;
72
73 // Select row and wait for row selecton to stabilize
74 select_row(current_row);
75 matrix_io_delay();
76
77 uint8_t port_expander_col_buffer[2];
78 i2c_readReg((PORT_EXPANDER_ADDRESS << 1), 0x12, &port_expander_col_buffer[0], 2, 20);
79
80 // For each col...
81 for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
82 uint8_t pin_state;
83 // Select the col pin to read (active low)
84 switch (col_index) {
85 case 8 :
86 pin_state = port_expander_col_buffer[0] & (1 << 0);
87 break;
88 case 9 :
89 pin_state = port_expander_col_buffer[0] & (1 << 1);
90 break;
91 case 10 :
92 pin_state = port_expander_col_buffer[0] & (1 << 2);
93 break;
94 case 11 :
95 pin_state = port_expander_col_buffer[0] & (1 << 3);
96 break;
97 case 12 :
98 pin_state = port_expander_col_buffer[0] & (1 << 4);
99 break;
100 case 13 :
101 pin_state = port_expander_col_buffer[0] & (1 << 5);
102 break;
103 case 14 :
104 pin_state = port_expander_col_buffer[0] & (1 << 6);
105 break;
106 case 15 :
107 pin_state = port_expander_col_buffer[0] & (1 << 7);
108 break;
109 case 16 :
110 pin_state = port_expander_col_buffer[1] & (1 << 0);
111 break;
112 case 17 :
113 pin_state = port_expander_col_buffer[1] & (1 << 1);
114 break;
115 default :
116 pin_state = readPin(col_pins[col_index]);
117 }
118
119 // Populate the matrix row with the state of the col pin
120 current_matrix[current_row] |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
121 }
122
123 // Unselect row
124 unselect_row(current_row);
125
126 return (last_row_value != current_matrix[current_row]);
127}
128
129bool matrix_scan_custom(matrix_row_t current_matrix[]) {
130 bool matrix_has_changed = false;
131
132 // Set row, read cols
133 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
134 matrix_has_changed |= read_cols_on_row(current_matrix, current_row);
135 }
136
137 return matrix_has_changed;
138}
diff --git a/keyboards/barleycorn_smd/readme.md b/keyboards/barleycorn_smd/readme.md
new file mode 100644
index 000000000..897e1270f
--- /dev/null
+++ b/keyboards/barleycorn_smd/readme.md
@@ -0,0 +1,19 @@
1# Barleycorn SMD
2
3![image](https://user-images.githubusercontent.com/3302524/110901245-a5679b00-82c9-11eb-8f8f-17ed6bd97332.png)
4
5An f-row less compact 1800 keyboard with SMD components. Based on Barleycorn by Yiancar.
6
7- Keyboard Maintainer: matthewdias
8- Hardware Supported: Barleycorn SMD
9- Hardware Availability: https://p3dstore.com
10
11Make example for this keyboard (after setting up your build environment):
12
13 make barleycorn_smd:default
14
15Flashing example for this keyboard:
16
17 make barleycorn_smd:default:flash
18
19See 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/barleycorn_smd/rules.mk b/keyboards/barleycorn_smd/rules.mk
new file mode 100644
index 000000000..fba31123d
--- /dev/null
+++ b/keyboards/barleycorn_smd/rules.mk
@@ -0,0 +1,27 @@
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 = lite # Virtual DIP switch configuration
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
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18NKRO_ENABLE = no # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24CUSTOM_MATRIX = lite
25
26SRC += matrix.c
27QUANTUM_LIB_SRC += i2c_master.c