aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/handwired/symmetric70_proto/config.h150
-rw-r--r--keyboards/handwired/symmetric70_proto/info.json87
-rw-r--r--keyboards/handwired/symmetric70_proto/keymaps/default/keymap.c54
-rw-r--r--keyboards/handwired/symmetric70_proto/keymaps/default/readme.md9
-rw-r--r--keyboards/handwired/symmetric70_proto/keymaps/default_mac/keymap.c54
-rw-r--r--keyboards/handwired/symmetric70_proto/keymaps/default_mac/readme.md9
-rw-r--r--keyboards/handwired/symmetric70_proto/matrix.c226
-rw-r--r--keyboards/handwired/symmetric70_proto/readme.md20
-rw-r--r--keyboards/handwired/symmetric70_proto/rules.mk27
-rw-r--r--keyboards/handwired/symmetric70_proto/symmetric70_proto.c25
-rw-r--r--keyboards/handwired/symmetric70_proto/symmetric70_proto.h41
11 files changed, 702 insertions, 0 deletions
diff --git a/keyboards/handwired/symmetric70_proto/config.h b/keyboards/handwired/symmetric70_proto/config.h
new file mode 100644
index 000000000..2cdce5802
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/config.h
@@ -0,0 +1,150 @@
1/*
2Copyright 2020 mtei
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/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x2BE5
25#define DEVICE_VER 0x0001
26#define MANUFACTURER mtei
27#define PRODUCT Symmetric70 prototype
28
29/* key matrix size */
30#define MATRIX_ROWS 5
31#define MATRIX_COLS 16
32
33/*
34 * Keyboard Matrix Assignments
35 *
36 * Change this to how you wired your keyboard
37 * COLS: AVR pins used for columns, left to right
38 * ROWS: AVR pins used for rows, top to bottom
39 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
40 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
41 *
42 */
43#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 }
44#define MATRIX_COL_PINS { F4,F4,F5,F5, F6,F6,F7,F7, B6,B6,B2,B2, B3,B3,B1,B1 }
45#define UNUSED_PINS
46
47#define MATRIX_MUL_SEL { 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0 }
48/* use 74HC157: quadruple 2-line to 1-line data selectors / multiplexers */
49#define MATRIX_MUL_SELECT B5 /* 74HC157 pin1:~A/B */
50
51/* COL2ROW, ROW2COL */
52#define DIODE_DIRECTION COL2ROW
53
54/*
55 * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
56 */
57#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
58
59//#define BACKLIGHT_PIN B7
60//#define BACKLIGHT_LEVELS 3
61//#define BACKLIGHT_BREATHING
62
63//#define RGB_DI_PIN E2
64//#ifdef RGB_DI_PIN
65//# define RGBLED_NUM 16
66//# define RGBLIGHT_HUE_STEP 8
67//# define RGBLIGHT_SAT_STEP 8
68//# define RGBLIGHT_VAL_STEP 8
69//# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
70//# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
71/*== all animations enable ==*/
72//# define RGBLIGHT_ANIMATIONS
73/*== or choose animations ==*/
74//# define RGBLIGHT_EFFECT_BREATHING
75//# define RGBLIGHT_EFFECT_RAINBOW_MOOD
76//# define RGBLIGHT_EFFECT_RAINBOW_SWIRL
77//# define RGBLIGHT_EFFECT_SNAKE
78//# define RGBLIGHT_EFFECT_KNIGHT
79//# define RGBLIGHT_EFFECT_CHRISTMAS
80//# define RGBLIGHT_EFFECT_STATIC_GRADIENT
81//# define RGBLIGHT_EFFECT_RGB_TEST
82//# define RGBLIGHT_EFFECT_ALTERNATING
83/*== customize breathing effect ==*/
84/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
85//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
86/*==== use exp() and sin() ====*/
87//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
88//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
89//#endif
90
91/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
92#define DEBOUNCE 5
93
94/* define if matrix has ghost (lacks anti-ghosting diodes) */
95//#define MATRIX_HAS_GHOST
96
97/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
98#define LOCKING_SUPPORT_ENABLE
99/* Locking resynchronize hack */
100#define LOCKING_RESYNC_ENABLE
101
102/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
103 * This is useful for the Windows task manager shortcut (ctrl+shift+esc).
104 */
105//#define GRAVE_ESC_CTRL_OVERRIDE
106
107/*
108 * Force NKRO
109 *
110 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
111 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
112 * makefile for this to work.)
113 *
114 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
115 * until the next keyboard reset.
116 *
117 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
118 * fully operational during normal computer usage.
119 *
120 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
121 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
122 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
123 * power-up.
124 *
125 */
126//#define FORCE_NKRO
127
128/*
129 * Feature disable options
130 * These options are also useful to firmware size reduction.
131 */
132
133/* disable debug print */
134//#define NO_DEBUG
135
136/* disable print */
137//#define NO_PRINT
138
139/* disable action features */
140//#define NO_ACTION_LAYER
141//#define NO_ACTION_TAPPING
142//#define NO_ACTION_ONESHOT
143
144/* disable these deprecated features by default */
145#define NO_ACTION_MACRO
146#define NO_ACTION_FUNCTION
147
148/* Bootmagic Lite key configuration */
149//#define BOOTMAGIC_LITE_ROW 0
150//#define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/handwired/symmetric70_proto/info.json b/keyboards/handwired/symmetric70_proto/info.json
new file mode 100644
index 000000000..abb0976a3
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/info.json
@@ -0,0 +1,87 @@
1{
2 "keyboard_name": "symmetric70_proto",
3 "url": "",
4 "maintainer": "mtei",
5 "width": 16,
6 "height": 5,
7 "layouts": {
8 "LAYOUT": {
9 "layout": [
10 {"label":"L00", "x":0, "y":0, "w":1.25},
11 {"label":"L01", "x":1.25, "y":0},
12 {"label":"L02", "x":2.25, "y":0},
13 {"label":"L03", "x":3.25, "y":0},
14 {"label":"L04", "x":4.25, "y":0},
15 {"label":"L05", "x":5.25, "y":0},
16 {"label":"L06", "x":6.25, "y":0},
17 {"label":"R06", "x":8.75, "y":0},
18 {"label":"R05", "x":9.75, "y":0},
19 {"label":"R04", "x":10.75, "y":0},
20 {"label":"R03", "x":11.75, "y":0},
21 {"label":"R02", "x":12.75, "y":0},
22 {"label":"R01", "x":13.75, "y":0},
23 {"label":"R00", "x":14.75, "y":0, "w":1.25},
24
25 {"label":"L10", "x":0, "y":1, "w":1.5},
26 {"label":"L11", "x":1.5, "y":1},
27 {"label":"L12", "x":2.5, "y":1},
28 {"label":"L13", "x":3.5, "y":1},
29 {"label":"L14", "x":4.5, "y":1},
30 {"label":"L15", "x":5.5, "y":1},
31 {"label":"L16", "x":6.5, "y":1},
32 {"label":"R16", "x":8.5, "y":1},
33 {"label":"R15", "x":9.5, "y":1},
34 {"label":"R14", "x":10.5, "y":1},
35 {"label":"R13", "x":11.5, "y":1},
36 {"label":"R12", "x":12.5, "y":1},
37 {"label":"R11", "x":13.5, "y":1},
38 {"label":"R10", "x":14.5, "y":1, "w":1.5},
39
40 {"label":"L20", "x":0, "y":2, "w":1.25},
41 {"label":"L21", "x":1.25, "y":2},
42 {"label":"L22", "x":2.25, "y":2},
43 {"label":"L23", "x":3.25, "y":2},
44 {"label":"L24", "x":4.25, "y":2},
45 {"label":"L25", "x":5.25, "y":2},
46 {"label":"L26", "x":6.25, "y":2},
47 {"label":"R26", "x":8.75, "y":2},
48 {"label":"R25", "x":9.75, "y":2},
49 {"label":"R24", "x":10.75, "y":2},
50 {"label":"R23", "x":11.75, "y":2},
51 {"label":"R22", "x":12.75, "y":2},
52 {"label":"R21", "x":13.75, "y":2},
53 {"label":"R20", "x":14.75, "y":2, "w":1.25},
54
55 {"label":"L30", "x":0, "y":3},
56 {"label":"L31", "x":1, "y":3},
57 {"label":"L32", "x":2, "y":3},
58 {"label":"L33", "x":3, "y":3},
59 {"label":"L34", "x":4, "y":3},
60 {"label":"L35", "x":5, "y":3},
61 {"label":"L36", "x":6, "y":3},
62 {"label":"L37", "x":7, "y":3},
63 {"label":"R37", "x":8, "y":3},
64 {"label":"R36", "x":9, "y":3},
65 {"label":"R35", "x":10, "y":3},
66 {"label":"R34", "x":11, "y":3},
67 {"label":"R33", "x":12, "y":3},
68 {"label":"R32", "x":13, "y":3},
69 {"label":"R31", "x":14, "y":3},
70 {"label":"R30", "x":15, "y":3},
71
72 {"label":"L40", "x":0, "y":4, "w":1.75},
73 {"label":"L42", "x":1.75, "y":4, "w":1.25},
74 {"label":"L43", "x":3, "y":4, "w":1.25},
75 {"label":"L44", "x":4.25, "y":4},
76 {"label":"L45", "x":5.25, "y":4, "w":1.25},
77 {"label":"L47", "x":6.5, "y":4, "w":1.5},
78 {"label":"R47", "x":8, "y":4, "w":1.5},
79 {"label":"R45", "x":9.5, "y":4, "w":1.25},
80 {"label":"R44", "x":10.75, "y":4},
81 {"label":"R43", "x":11.75, "y":4, "w":1.25},
82 {"label":"R42", "x":13, "y":4, "w":1.25},
83 {"label":"R40", "x":14.25, "y":4, "w":1.75}
84 ]
85 }
86 }
87}
diff --git a/keyboards/handwired/symmetric70_proto/keymaps/default/keymap.c b/keyboards/handwired/symmetric70_proto/keymaps/default/keymap.c
new file mode 100644
index 000000000..d39690714
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/keymaps/default/keymap.c
@@ -0,0 +1,54 @@
1/* Copyright 2020 mtei
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// Defines names for use in layer keycodes and the keymap
19enum layer_names {
20 _BASE,
21 _FN
22};
23
24#define KC_FUNC MO(_FN)
25
26// clang-format off
27
28const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 /* Base */
30 [_BASE] = LAYOUT(
31 //_ESC_1_2_3_4_5_NO _NO_6_7_8_9_0_BSPC
32 //_TAB_Q_W_E_R_T_MINS _EQL_Y_U_I_O_P_BSLS
33 //_LCTL_A_S_D_F_G_LBRC _RBRC_H_J_K_L_SCLN_RCTL
34 //_LSFT_Z_X_C_V_B_GRV_NO _NO_QUOT_N_M_COMM_DOT_SLSH_RSFT
35 //_FUNC_CAPS_LALT_LGUI_SPC_BSPC _ENT_SPC_RGUI_RALT_APP_FUNC
36 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
37 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
38 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LBRC, KC_RBRC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RCTL,
39 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_NO, KC_NO, KC_QUOT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
40 KC_FUNC, KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, KC_RGUI, KC_RALT, KC_APP, KC_FUNC
41 ),
42 [_FN] = LAYOUT(
43 //_NO_F1_F2_F3_F4_F5_NO _NO_F6_F7_F8_F9_F10_F11
44 //_NO_NO_PAUS_SLCK_NO_NO_NO _NO_NO_NO_SLCK_PAUS_NO_F12
45 //_TRNS_HOME_NO_UP_NO_PGUP_INS _INS_PGUP_NO_UP_NO_HOME_TRNS
46 //_TRNS_END_LEFT_DOWN_RGHT_PGDN_DEL_TRNS _TRNS_DEL_PGDN_LEFT_DOWN_RGHT_END_TRNS
47 //_TRNS_PSCR_TRNS_TRNS_NO_NO _NO_NO_TRNS_TRNS_PSCR_TRNS
48 KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
49 KC_NO, KC_NO, KC_PAUS, KC_SLCK, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLCK, KC_PAUS, KC_NO, KC_F12,
50 _______, KC_HOME, KC_NO, KC_UP, KC_NO, KC_PGUP, KC_INS, KC_INS, KC_PGUP, KC_NO, KC_UP, KC_NO, KC_HOME, _______,
51 _______, KC_END, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_DEL, KC_NO,KC_NO, KC_DEL, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______,
52 _______, KC_PSCR, _______, _______, KC_NO, KC_NO,KC_NO, KC_NO, _______, _______, KC_PSCR, _______
53 )
54};
diff --git a/keyboards/handwired/symmetric70_proto/keymaps/default/readme.md b/keyboards/handwired/symmetric70_proto/keymaps/default/readme.md
new file mode 100644
index 000000000..f9bb5bf67
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/keymaps/default/readme.md
@@ -0,0 +1,9 @@
1# The default keymap for symmetric70_proto
2
3```
4 ESC 1 2 3 4 5 6 7 8 9 0 BS
5 TAB Q W E R T - = Y U I O P \
6 CTL A S D F G [ ] H J K L ; CTL
7 SFT Z X C V B ` ' N M , . / SFT
8 FUNC CAPS ALT GUI SPC BS ENT SPC GUI RALT APP FUNC
9```
diff --git a/keyboards/handwired/symmetric70_proto/keymaps/default_mac/keymap.c b/keyboards/handwired/symmetric70_proto/keymaps/default_mac/keymap.c
new file mode 100644
index 000000000..30f42e70a
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/keymaps/default_mac/keymap.c
@@ -0,0 +1,54 @@
1/* Copyright 2020 mtei
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// Defines names for use in layer keycodes and the keymap
19enum layer_names {
20 _BASE,
21 _FN
22};
23
24#define KC_FUNC MO(_FN)
25
26// clang-format off
27
28const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
29 /* Base */
30 [_BASE] = LAYOUT(
31 //_ESC_1_2_3_4_5_NO _NO_6_7_8_9_0_BSPC
32 //_TAB_Q_W_E_R_T_MINS _EQL_Y_U_I_O_P_BSLS
33 //_LCTL_A_S_D_F_G_LBRC _RBRC_H_J_K_L_SCLN_RCTL
34 //_LSFT_Z_X_C_V_B_GRV_NO _NO_QUOT_N_M_COMM_DOT_SLSH_RSFT
35 //_FUNC_CAPS_LALT_LGUI_SPC_BSPC _ENT_SPC_RGUI_RALT_APP_FUNC
36 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
37 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
38 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LBRC, KC_RBRC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RCTL,
39 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_LANG2, KC_LANG1, KC_QUOT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
40 KC_FUNC, KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, KC_RGUI, KC_RALT, KC_APP, KC_FUNC
41 ),
42 [_FN] = LAYOUT(
43 //_NO_F1_F2_F3_F4_F5_NO _NO_F6_F7_F8_F9_F10_F11
44 //_NO_NO_PAUS_SLCK_NO_NO_NO _NO_NO_NO_SLCK_PAUS_NO_F12
45 //_TRNS_HOME_NO_UP_NO_PGUP_INS _INS_PGUP_NO_UP_NO_HOME_TRNS
46 //_TRNS_END_LEFT_DOWN_RGHT_PGDN_DEL_TRNS _TRNS_DEL_PGDN_LEFT_DOWN_RGHT_END_TRNS
47 //_TRNS_PSCR_TRNS_TRNS_NO_NO _NO_NO_TRNS_TRNS_PSCR_TRNS
48 KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
49 KC_NO, KC_NO, KC_PAUS, KC_SLCK, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_SLCK, KC_PAUS, KC_NO, KC_F12,
50 _______, KC_HOME, KC_NO, KC_UP, KC_NO, KC_PGUP, KC_INS, KC_INS, KC_PGUP, KC_NO, KC_UP, KC_NO, KC_HOME, _______,
51 _______, KC_END, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_DEL, KC_NO,KC_NO, KC_DEL, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______,
52 _______, KC_PSCR, _______, _______, KC_NO, KC_NO,KC_NO, KC_NO, _______, _______, KC_PSCR, _______
53 )
54};
diff --git a/keyboards/handwired/symmetric70_proto/keymaps/default_mac/readme.md b/keyboards/handwired/symmetric70_proto/keymaps/default_mac/readme.md
new file mode 100644
index 000000000..c533e3283
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/keymaps/default_mac/readme.md
@@ -0,0 +1,9 @@
1# The default_mac keymap for symmetric70_proto
2
3```
4 ESC 1 2 3 4 5 6 7 8 9 0 BS
5 TAB Q W E R T - = Y U I O P \
6 CTL A S D F G [ ] H J K L ; CTL
7 SFT Z X C V B ` LANG2 LANG1 ' N M , . / SFT
8 FUNC CAPS ALT GUI SPC BS ENT SPC GUI RALT APP FUNC
9```
diff --git a/keyboards/handwired/symmetric70_proto/matrix.c b/keyboards/handwired/symmetric70_proto/matrix.c
new file mode 100644
index 000000000..c01612073
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/matrix.c
@@ -0,0 +1,226 @@
1/*
2Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar
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 "util.h"
20#include "matrix.h"
21#include "debounce.h"
22#include "quantum.h"
23
24#ifdef DIRECT_PINS
25static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS;
26#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
27static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
28static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
29# ifdef MATRIX_MUL_SELECT
30static const pin_t col_sel[MATRIX_COLS] = MATRIX_MUL_SEL;
31# ifndef MATRIX_MUL_SELECT_DELAY
32# define MATRIX_MUL_SELECT_DELAY 1
33# endif
34# endif
35#endif
36
37/* matrix state(1:on, 0:off) */
38extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
39extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
40
41// matrix code
42
43#ifdef DIRECT_PINS
44
45static void init_pins(void) {
46 for (int row = 0; row < MATRIX_ROWS; row++) {
47 for (int col = 0; col < MATRIX_COLS; col++) {
48 pin_t pin = direct_pins[row][col];
49 if (pin != NO_PIN) {
50 setPinInputHigh(pin);
51 }
52 }
53 }
54}
55
56static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
57 // Start with a clear matrix row
58 matrix_row_t current_row_value = 0;
59
60 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
61 pin_t pin = direct_pins[current_row][col_index];
62 if (pin != NO_PIN) {
63 current_row_value |= readPin(pin) ? 0 : (MATRIX_ROW_SHIFTER << col_index);
64 }
65 }
66
67 // If the row has changed, store the row and return the changed flag.
68 if (current_matrix[current_row] != current_row_value) {
69 current_matrix[current_row] = current_row_value;
70 return true;
71 }
72 return false;
73}
74
75#elif defined(DIODE_DIRECTION)
76# if (DIODE_DIRECTION == COL2ROW)
77
78static void select_row(uint8_t row) {
79 setPinOutput(row_pins[row]);
80 writePinLow(row_pins[row]);
81}
82
83static void unselect_row(uint8_t row) { setPinInputHigh(row_pins[row]); }
84
85static void unselect_rows(void) {
86 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
87 setPinInputHigh(row_pins[x]);
88 }
89}
90
91static void init_pins(void) {
92#ifdef MATRIX_MUL_SELECT
93 setPinOutput(MATRIX_MUL_SELECT);
94 writePinLow(MATRIX_MUL_SELECT);
95#endif
96 unselect_rows();
97 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
98 setPinInputHigh(col_pins[x]);
99 }
100}
101
102static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
103 // Start with a clear matrix row
104 matrix_row_t current_row_value = 0;
105
106 // Select row and wait for row selecton to stabilize
107 select_row(current_row);
108 matrix_io_delay();
109
110 // For each col...
111 for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
112 // Select the col pin to read (active low)
113#ifdef MATRIX_MUL_SELECT
114 writePin(MATRIX_MUL_SELECT,col_sel[col_index]);
115 __builtin_avr_delay_cycles(MATRIX_MUL_SELECT_DELAY);
116#endif
117 uint8_t pin_state = readPin(col_pins[col_index]);
118
119 // Populate the matrix row with the state of the col pin
120 current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
121 }
122
123 // Unselect row
124 unselect_row(current_row);
125
126 // If the row has changed, store the row and return the changed flag.
127 if (current_matrix[current_row] != current_row_value) {
128 current_matrix[current_row] = current_row_value;
129 return true;
130 }
131 return false;
132}
133
134# elif (DIODE_DIRECTION == ROW2COL)
135
136static void select_col(uint8_t col) {
137 setPinOutput(col_pins[col]);
138 writePinLow(col_pins[col]);
139}
140
141static void unselect_col(uint8_t col) { setPinInputHigh(col_pins[col]); }
142
143static void unselect_cols(void) {
144 for (uint8_t x = 0; x < MATRIX_COLS; x++) {
145 setPinInputHigh(col_pins[x]);
146 }
147}
148
149static void init_pins(void) {
150 unselect_cols();
151 for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
152 setPinInputHigh(row_pins[x]);
153 }
154}
155
156static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) {
157 bool matrix_changed = false;
158
159 // Select col and wait for col selecton to stabilize
160 select_col(current_col);
161 matrix_io_delay();
162
163 // For each row...
164 for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
165 // Store last value of row prior to reading
166 matrix_row_t last_row_value = current_matrix[row_index];
167 matrix_row_t current_row_value = last_row_value;
168
169 // Check row pin state
170 if (readPin(row_pins[row_index]) == 0) {
171 // Pin LO, set col bit
172 current_row_value |= (MATRIX_ROW_SHIFTER << current_col);
173 } else {
174 // Pin HI, clear col bit
175 current_row_value &= ~(MATRIX_ROW_SHIFTER << current_col);
176 }
177
178 // Determine if the matrix changed state
179 if ((last_row_value != current_row_value)) {
180 matrix_changed |= true;
181 current_matrix[row_index] = current_row_value;
182 }
183 }
184
185 // Unselect col
186 unselect_col(current_col);
187
188 return matrix_changed;
189}
190
191# else
192# error DIODE_DIRECTION must be one of COL2ROW or ROW2COL!
193# endif
194#else
195# error DIODE_DIRECTION is not defined!
196#endif
197
198void matrix_init_custom(void) {
199 // initialize key pins
200 init_pins();
201
202 // initialize matrix state: all keys off
203 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
204 raw_matrix[i] = 0;
205 matrix[i] = 0;
206 }
207
208}
209
210bool matrix_scan_custom(matrix_row_t current_matrix[]) {
211 bool changed = false;
212
213#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW)
214 // Set row, read cols
215 for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
216 changed |= read_cols_on_row(current_matrix, current_row);
217 }
218#elif (DIODE_DIRECTION == ROW2COL)
219 // Set col, read rows
220 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
221 changed |= read_rows_on_col(current_matrix, current_col);
222 }
223#endif
224
225 return changed;
226}
diff --git a/keyboards/handwired/symmetric70_proto/readme.md b/keyboards/handwired/symmetric70_proto/readme.md
new file mode 100644
index 000000000..01c2889c2
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/readme.md
@@ -0,0 +1,20 @@
1# symmetric70_proto
2
3![symmetric70_proto](https://i.imgur.com/Br4pH9ol.jpg)
4![74HC157_schematic](https://i.imgur.com/8IU8Jgcl.jpg)
5
6A compact 70keys keyboard (prototype) designed by mtei
7
8* Keyboard Maintainer: [mtei](https://github.com/mtei)
9* Hardware Supported: Pro Micro (ATmega32U4) & 74HC157
10* Hardware Availability: This is just prototype
11
12Make example for this keyboard (after setting up your build environment):
13
14 make symmetric70_proto:default
15
16Flashing example for this keyboard:
17
18 make symmetric70_proto:default:flash
19
20See 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/handwired/symmetric70_proto/rules.mk b/keyboards/handwired/symmetric70_proto/rules.mk
new file mode 100644
index 000000000..494dc6fba
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/rules.mk
@@ -0,0 +1,27 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = no # Mouse keys
12EXTRAKEY_ENABLE = no # 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 = no # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24CUSTOM_MATRIX = lite
25SRC += matrix.c
26
27## CONSOLE_ENABLE = yes # matrix dump
diff --git a/keyboards/handwired/symmetric70_proto/symmetric70_proto.c b/keyboards/handwired/symmetric70_proto/symmetric70_proto.c
new file mode 100644
index 000000000..daab4f099
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/symmetric70_proto.c
@@ -0,0 +1,25 @@
1/* Copyright 2020 mtei
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#include "symmetric70_proto.h"
18
19__attribute__((weak)) void keyboard_post_init_user(void) {
20 // Customise these values to desired behaviour
21 debug_enable=true;
22 debug_matrix=true;
23 //debug_keyboard=true;
24 //debug_mouse=true;
25}
diff --git a/keyboards/handwired/symmetric70_proto/symmetric70_proto.h b/keyboards/handwired/symmetric70_proto/symmetric70_proto.h
new file mode 100644
index 000000000..4a8539b50
--- /dev/null
+++ b/keyboards/handwired/symmetric70_proto/symmetric70_proto.h
@@ -0,0 +1,41 @@
1/* Copyright 2020 mtei
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#include "quantum.h"
20
21/* This is a shortcut to help you visually see your layout.
22 *
23 * The first section contains all of the arguments representing the physical
24 * layout of the board and position of the keys.
25 *
26 * The second converts the arguments into a two-dimensional array which
27 * represents the switch matrix.
28 */
29#define LAYOUT( \
30 L00, L01, L02, L03, L04, L05, L06, R06, R05, R04, R03, R02, R01, R00, \
31 L10, L11, L12, L13, L14, L15, L16, R16, R15, R14, R13, R12, R11, R10, \
32 L20, L21, L22, L23, L24, L25, L26, R26, R25, R24, R23, R22, R21, R20, \
33 L30, L31, L32, L33, L34, L35, L36, L37, R37, R36, R35, R34, R33, R32, R31, R30, \
34 L40, L42, L43, L44, L45, L47, R47, R45, R44, R43, R42, R40 \
35) { \
36 { L00, L01, L02, L03, L04, L05, L06, KC_NO, KC_NO, R06, R05, R04, R03, R02, R01, R00 }, \
37 { L10, L11, L12, L13, L14, L15, L16, KC_NO, KC_NO, R16, R15, R14, R13, R12, R11, R10 }, \
38 { L20, L21, L22, L23, L24, L25, L26, KC_NO, KC_NO, R26, R25, R24, R23, R22, R21, R20 }, \
39 { L30, L31, L32, L33, L34, L35, L36, L37, R37, R36, R35, R34, R33, R32, R31, R30 }, \
40 { L40, KC_NO, L42, L43, L44, L45, KC_NO, L47, R47, KC_NO, R45, R44, R43, R42, KC_NO, R40 } \
41}