aboutsummaryrefslogtreecommitdiff
path: root/keyboards/amj96
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/amj96')
-rw-r--r--keyboards/amj96/amj96.c43
-rw-r--r--keyboards/amj96/amj96.h43
-rw-r--r--keyboards/amj96/config.h203
-rw-r--r--keyboards/amj96/info.json16
-rw-r--r--keyboards/amj96/keymaps/default/config.h24
-rw-r--r--keyboards/amj96/keymaps/default/keymap.c71
-rw-r--r--keyboards/amj96/keymaps/default/readme.md1
-rw-r--r--keyboards/amj96/matrix.c222
-rw-r--r--keyboards/amj96/readme.md16
-rw-r--r--keyboards/amj96/rules.mk72
10 files changed, 711 insertions, 0 deletions
diff --git a/keyboards/amj96/amj96.c b/keyboards/amj96/amj96.c
new file mode 100644
index 000000000..959e321c8
--- /dev/null
+++ b/keyboards/amj96/amj96.c
@@ -0,0 +1,43 @@
1/* Copyright 2017 MechMerlin
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 "amj96.h"
17
18void matrix_init_kb(void) {
19 // put your keyboard start-up code here
20 // runs once when the firmware starts up
21
22 matrix_init_user();
23}
24
25void matrix_scan_kb(void) {
26 // put your looping keyboard code here
27 // runs every cycle (a lot)
28
29 matrix_scan_user();
30}
31
32bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
33 // put your per-action keyboard code here
34 // runs for every action, just before processing by the firmware
35
36 return process_record_user(keycode, record);
37}
38
39void led_set_kb(uint8_t usb_led) {
40 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
41
42 led_set_user(usb_led);
43}
diff --git a/keyboards/amj96/amj96.h b/keyboards/amj96/amj96.h
new file mode 100644
index 000000000..37bb6566f
--- /dev/null
+++ b/keyboards/amj96/amj96.h
@@ -0,0 +1,43 @@
1/* Copyright 2017 MechMerlin
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#ifndef AMJ96_H
17#define AMJ96_H
18
19#include "quantum.h"
20
21// This a shortcut to help you visually see your layout.
22// The following is an example using the Planck MIT layout
23// The first section contains all of the arguments
24// The second converts the arguments into a two-dimensional array
25#define LAYOUT( \
26 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K09, K0A, K0C, \
27 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K0B, K0F, K6F,\
28 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K0D, K6D,\
29 K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, K6E,\
30 K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, K5E, K5F, K0E, K07,\
31 K60, K61, K62, K63, K64, K65, K66, K68, K69, K6A, K6B, K6C\
32) { \
33 { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K07, KC_NO, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F}, \
34 { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F}, \
35 { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F}, \
36 { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F}, \
37 { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F}, \
38 { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F}, \
39 { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_NO, KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F} \
40}
41
42
43#endif
diff --git a/keyboards/amj96/config.h b/keyboards/amj96/config.h
new file mode 100644
index 000000000..1ba35b54d
--- /dev/null
+++ b/keyboards/amj96/config.h
@@ -0,0 +1,203 @@
1/*
2Copyright 2017 MechMerlin
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#ifndef CONFIG_H
19#define CONFIG_H
20
21#include "config_common.h"
22
23/* USB Device descriptor parameter */
24#define VENDOR_ID 0xFEED
25#define PRODUCT_ID 0x6074
26#define DEVICE_VER 0x0002
27#define MANUFACTURER Han Chen
28#define PRODUCT AMJ96
29#define DESCRIPTION 96 key custom keyboard
30
31/* key matrix size */
32#define MATRIX_ROWS 7
33#define MATRIX_COLS 16
34
35/*
36 * Keyboard Matrix Assignments
37 *
38 * Change this to how you wired your keyboard
39 * COLS: AVR pins used for columns, left to right
40 * ROWS: AVR pins used for rows, top to bottom
41 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
42 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
43 *
44*/
45#define UNUSED_PINS
46
47/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
48#define DIODE_DIRECTION COL2ROW
49
50// #define BACKLIGHT_PIN D4
51// #define BACKLIGHT_BREATHING
52// #define BACKLIGHT_LEVELS 3
53
54/* number of backlight levels */
55#ifdef BREATHING_LED_ENABLE
56#ifdef FADING_LED_ENABLE
57#define BACKLIGHT_LEVELS 8
58#else
59#define BACKLIGHT_LEVELS 6
60#endif
61#else
62#define BACKLIGHT_LEVELS 3
63#endif
64#define BACKLIGHT_CUSTOM
65
66/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
67#define DEBOUNCING_DELAY 5
68
69/* define if matrix has ghost (lacks anti-ghosting diodes) */
70//#define MATRIX_HAS_GHOST
71
72/* number of backlight levels */
73
74/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
75#define LOCKING_SUPPORT_ENABLE
76/* Locking resynchronize hack */
77#define LOCKING_RESYNC_ENABLE
78
79/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
80 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
81 */
82// #define GRAVE_ESC_CTRL_OVERRIDE
83
84/*
85 * Force NKRO
86 *
87 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
88 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
89 * makefile for this to work.)
90 *
91 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
92 * until the next keyboard reset.
93 *
94 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
95 * fully operational during normal computer usage.
96 *
97 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
98 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
99 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
100 * power-up.
101 *
102 */
103//#define FORCE_NKRO
104
105/*
106 * Magic Key Options
107 *
108 * Magic keys are hotkey commands that allow control over firmware functions of
109 * the keyboard. They are best used in combination with the HID Listen program,
110 * found here: https://www.pjrc.com/teensy/hid_listen.html
111 *
112 * The options below allow the magic key functionality to be changed. This is
113 * useful if your keyboard/keypad is missing keys and you want magic key support.
114 *
115 */
116
117/* key combination for magic key command */
118#define IS_COMMAND() ( \
119 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
120)
121
122/* control how magic key switches layers */
123//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
124//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
125//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
126
127/* override magic key keymap */
128//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
129//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
130//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
131//#define MAGIC_KEY_HELP1 H
132//#define MAGIC_KEY_HELP2 SLASH
133//#define MAGIC_KEY_DEBUG D
134//#define MAGIC_KEY_DEBUG_MATRIX X
135//#define MAGIC_KEY_DEBUG_KBD K
136//#define MAGIC_KEY_DEBUG_MOUSE M
137//#define MAGIC_KEY_VERSION V
138//#define MAGIC_KEY_STATUS S
139//#define MAGIC_KEY_CONSOLE C
140//#define MAGIC_KEY_LAYER0_ALT1 ESC
141//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
142//#define MAGIC_KEY_LAYER0 0
143//#define MAGIC_KEY_LAYER1 1
144//#define MAGIC_KEY_LAYER2 2
145//#define MAGIC_KEY_LAYER3 3
146//#define MAGIC_KEY_LAYER4 4
147//#define MAGIC_KEY_LAYER5 5
148//#define MAGIC_KEY_LAYER6 6
149//#define MAGIC_KEY_LAYER7 7
150//#define MAGIC_KEY_LAYER8 8
151//#define MAGIC_KEY_LAYER9 9
152//#define MAGIC_KEY_BOOTLOADER PAUSE
153//#define MAGIC_KEY_LOCK CAPS
154//#define MAGIC_KEY_EEPROM E
155//#define MAGIC_KEY_NKRO N
156//#define MAGIC_KEY_SLEEP_LED Z
157
158/*
159 * Feature disable options
160 * These options are also useful to firmware size reduction.
161 */
162
163/* disable debug print */
164//#define NO_DEBUG
165
166/* disable print */
167//#define NO_PRINT
168
169/* disable action features */
170//#define NO_ACTION_LAYER
171//#define NO_ACTION_TAPPING
172//#define NO_ACTION_ONESHOT
173//#define NO_ACTION_MACRO
174//#define NO_ACTION_FUNCTION
175
176/*
177 * MIDI options
178 */
179
180/* Prevent use of disabled MIDI features in the keymap */
181//#define MIDI_ENABLE_STRICT 1
182
183/* enable basic MIDI features:
184 - MIDI notes can be sent when in Music mode is on
185*/
186//#define MIDI_BASIC
187
188/* enable advanced MIDI features:
189 - MIDI notes can be added to the keymap
190 - Octave shift and transpose
191 - Virtual sustain, portamento, and modulation wheel
192 - etc.
193*/
194//#define MIDI_ADVANCED
195
196/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
197//#define MIDI_TONE_KEYCODE_OCTAVES 1
198
199#define RGBLIGHT_ANIMATIONS
200#define RGBLED_NUM 16
201#define RGB_DI_PIN D3
202
203#endif
diff --git a/keyboards/amj96/info.json b/keyboards/amj96/info.json
new file mode 100644
index 000000000..13bcd6a92
--- /dev/null
+++ b/keyboards/amj96/info.json
@@ -0,0 +1,16 @@
1{
2 "keyboard_name": "AMJ96",
3 "manufacturer": "AMJ",
4 "identifier": "",
5 "url": "",
6 "maintainer": "qmk",
7 "processor": "atmega32u4",
8 "bootloader": "atmel-dfu",
9 "width": 19,
10 "height": 6,
11 "layouts": {
12 "LAYOUT": {
13 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Scroll Lock", "x":14, "y":0}, {"label":"Pause", "x":15, "y":0}, {"label":"Num Lock", "x":16, "y":0}, {"label":"/", "x":17, "y":0}, {"label":"*", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Insert", "x":15, "y":1}, {"label":"Home", "x":16, "y":1}, {"label":"PgUp", "x":17, "y":1}, {"label":"-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Delete", "x":15, "y":2}, {"label":"End", "x":16, "y":2}, {"label":"PgDn", "x":17, "y":2}, {"label":"7", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"8", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"1", "x":14, "y":4}, {"label":"\u2191", "x":15, "y":4}, {"label":"\u2190", "x":16, "y":4}, {"label":"\u2193", "x":17, "y":4}, {"label":"\u2192", "x":18, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.25}, {"label":"Win", "x":11.25, "y":5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5, "w":1.25}, {"label":"2", "x":15, "y":5}, {"label":".", "x":16, "y":5}, {"label":"3", "x":17, "y":5}, {"label":"9", "x":18, "y":5}]
14 }
15 }
16}
diff --git a/keyboards/amj96/keymaps/default/config.h b/keyboards/amj96/keymaps/default/config.h
new file mode 100644
index 000000000..5e346088e
--- /dev/null
+++ b/keyboards/amj96/keymaps/default/config.h
@@ -0,0 +1,24 @@
1/* Copyright 2017 MechMerlin
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#ifndef CONFIG_USER_H
18#define CONFIG_USER_H
19
20#include "config_common.h"
21
22// place overrides here
23
24#endif
diff --git a/keyboards/amj96/keymaps/default/keymap.c b/keyboards/amj96/keymaps/default/keymap.c
new file mode 100644
index 000000000..72a44eedf
--- /dev/null
+++ b/keyboards/amj96/keymaps/default/keymap.c
@@ -0,0 +1,71 @@
1/* Copyright 2017 MechMerlin
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 "amj96.h"
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19
20 LAYOUT(
21 ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,PAUS, INS, DEL, PGUP,PGDN, \
22 GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,NO, NLCK,PSLS,PAST,PMNS, \
23 TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, P7, P8, P9, PPLS, \
24 CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, \
25 LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,UP, P1, P2, P3, PENT,\
26 LCTL,LGUI,LALT, SPC, RALT,FN0, LEFT,DOWN, RGHT,P0, PDOT, PENT),
27
28 LAYOUT(
29 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,\
30 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,NO, TRNS,TRNS,TRNS,TRNS,\
31 TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,\
32 TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,\
33 TRNS,NO, TRNS,TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,\
34 TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS)
35};
36
37const uint16_t PROGMEM fn_actions[] = {
38
39};
40
41const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
42{
43 // MACRODOWN only works in this function
44 switch(id) {
45 case 0:
46 if (record->event.pressed) {
47 register_code(KC_RSFT);
48 } else {
49 unregister_code(KC_RSFT);
50 }
51 break;
52 }
53 return MACRO_NONE;
54};
55
56
57void matrix_init_user(void) {
58
59}
60
61void matrix_scan_user(void) {
62
63}
64
65bool process_record_user(uint16_t keycode, keyrecord_t *record) {
66 return true;
67}
68
69void led_set_user(uint8_t usb_led) {
70
71}
diff --git a/keyboards/amj96/keymaps/default/readme.md b/keyboards/amj96/keymaps/default/readme.md
new file mode 100644
index 000000000..478ab9966
--- /dev/null
+++ b/keyboards/amj96/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for amj96
diff --git a/keyboards/amj96/matrix.c b/keyboards/amj96/matrix.c
new file mode 100644
index 000000000..e41bbec72
--- /dev/null
+++ b/keyboards/amj96/matrix.c
@@ -0,0 +1,222 @@
1/*
2Copyright 2014 Kai Ryu <kai1103@gmail.com>
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/*
19 * scan matrix
20 */
21#include <stdint.h>
22#include <stdbool.h>
23#include <avr/io.h>
24#include <util/delay.h>
25#include "print.h"
26#include "debug.h"
27#include "util.h"
28#include "matrix.h"
29#ifdef UART_RGB_ENABLE
30#include "uart_rgb.h"
31#endif
32
33#ifndef DEBOUNCE
34# define DEBOUNCE 5
35#endif
36static uint8_t debouncing = DEBOUNCE;
37
38/* matrix state(1:on, 0:off) */
39static matrix_row_t matrix[MATRIX_ROWS];
40static matrix_row_t matrix_debouncing[MATRIX_ROWS];
41
42static matrix_row_t read_cols(void);
43static void init_cols(void);
44static void init_rows(void);
45static void unselect_rows(void);
46static void select_row(uint8_t row);
47
48inline
49uint8_t matrix_rows(void)
50{
51 return MATRIX_ROWS;
52}
53
54inline
55uint8_t matrix_cols(void)
56{
57 return MATRIX_COLS;
58}
59
60void matrix_init(void)
61{
62
63#ifdef UART_RGB_ENABLE
64 uart_rgb_init();
65#endif
66 // disable JTAG
67 MCUCR = _BV(JTD);
68 MCUCR = _BV(JTD);
69
70 // 85 REST
71 DDRD |= _BV(PD7);
72 PORTD |= _BV(PD7);
73
74 // initialize row and col
75 init_rows();
76 init_cols();
77
78 // initialize matrix state: all keys off
79 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
80 matrix[i] = 0;
81 matrix_debouncing[i] = 0;
82 }
83}
84
85uint8_t matrix_scan(void)
86{
87 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
88 select_row(i);
89 _delay_us(30); // without this wait read unstable value.
90 matrix_row_t cols = read_cols();
91 if (matrix_debouncing[i] != cols) {
92 matrix_debouncing[i] = cols;
93 if (debouncing) {
94 debug("bounce!: "); debug_hex(debouncing); debug("\n");
95 }
96 debouncing = DEBOUNCE;
97 }
98 unselect_rows();
99 }
100
101 if (debouncing) {
102 if (--debouncing) {
103 _delay_ms(1);
104 } else {
105 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
106 matrix[i] = matrix_debouncing[i];
107 }
108 }
109 }
110
111 return 1;
112}
113
114bool matrix_is_modified(void)
115{
116 if (debouncing) return false;
117 return true;
118}
119
120inline
121bool matrix_is_on(uint8_t row, uint8_t col)
122{
123 return (matrix[row] & ((matrix_row_t)1<<col));
124}
125
126inline
127matrix_row_t matrix_get_row(uint8_t row)
128{
129 return matrix[row];
130}
131
132void matrix_print(void)
133{
134 print("\nr/c 0123456789ABCDEF\n");
135 for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
136 phex(row); print(": ");
137 pbin_reverse16(matrix_get_row(row));
138 print("\n");
139 }
140}
141
142uint8_t matrix_key_count(void)
143{
144 uint8_t count = 0;
145 for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
146 count += bitpop16(matrix[i]);
147 }
148 return count;
149}
150
151/* Column pin configuration
152 * col: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
153 * pin: F7 F6 F5 F4 F1 F0 E6 D7 D6 D5 D1 D0 B7 B6 B0 C7
154 * */
155static void init_cols(void)
156{
157 // Input with pull-up(DDR:0, PORT:1)
158 DDRF &= 0b00001100;
159 PORTF |= 0b11110011;
160
161 DDRD &= 0b00011100;
162 PORTD |= 0b11100011;
163
164 DDRB &= ~(_BV(PB6) | _BV(PB7)| _BV(PB0));
165 PORTB |= (_BV(PB6) | _BV(PB7)| _BV(PB0));
166
167 DDRE &= ~_BV(PE6);
168 PORTE |= _BV(PE6);
169
170 DDRC &= ~_BV(PC7);
171 PORTC |= _BV(PC7);
172
173}
174
175static matrix_row_t read_cols(void)
176{
177
178 return (PINF&_BV(PF7) ? 0 : (1<<0)) |
179 (PINF&_BV(PF6) ? 0 : (1<<1)) |
180 (PINF&_BV(PF5) ? 0 : (1<<2)) |
181 (PINF&_BV(PF4) ? 0 : (1<<3)) |
182 (PINF&_BV(PF1) ? 0 : (1<<4)) |
183 (PINF&_BV(PF0) ? 0 : (1<<5)) |
184 (PINE&_BV(PE6) ? 0 : (1<<6)) |
185 (PIND&_BV(PD7) ? 0 : (1<<7)) |
186 (PIND&_BV(PD6) ? 0 : (1<<8)) |
187 (PIND&_BV(PD5) ? 0 : (1<<9)) |
188 (PIND&_BV(PD1) ? 0 : (1<<10)) |
189 (PIND&_BV(PD0) ? 0 : (1<<11)) |
190 (PINB&_BV(PB7) ? 0 : (1<<12)) |
191 (PINB&_BV(PB6) ? 0 : (1<<13)) |
192 (PINB&_BV(PB0) ? 0 : (1<<14)) |
193 (PINC&_BV(PC7) ? 0 : (1<<15));
194}
195
196/* Row pin configuration
197 * row: 0 1 2 3 4 5 x
198 * pin: B3 0 1 0 1 0 1 1
199 * B2 0 0 1 1 0 0 1
200 * B1 0 0 0 0 1 1 1
201 */
202
203static void init_rows(void)
204{
205 DDRB |= (1<<PB1 | 1<<PB2 | 1<<PB3);
206}
207
208static void unselect_rows(void)
209{
210 // Hi-Z(DDR:0, PORT:0) to unselect
211 PORTB |= (1<<PB1);
212 PORTB |= (1<<PB2);
213 PORTB |= (1<<PB3);
214}
215
216static void select_row(uint8_t row)
217{
218 // Output low(DDR:1, PORT:0) to select
219 (row & (1<<0)) ? (PORTB |= (1<<PB3)) : (PORTB &= ~(1<<PB3));
220 (row & (1<<1)) ? (PORTB |= (1<<PB2)) : (PORTB &= ~(1<<PB2));
221 (row & (1<<2)) ? (PORTB |= (1<<PB1)) : (PORTB &= ~(1<<PB1));
222}
diff --git a/keyboards/amj96/readme.md b/keyboards/amj96/readme.md
new file mode 100644
index 000000000..96bbb4a71
--- /dev/null
+++ b/keyboards/amj96/readme.md
@@ -0,0 +1,16 @@
1# AMJ96
2
3The AMD96 is a 96 key custom keyboard with anodized aluminum case, twin usb ports, and support for backlight LEDs and RGB underglow via SMD LEDs.
4
5Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
6Hardware Supported: AMJ96
7Hardware Availability: Was previously available on a GB via [Flashquark](https://flashquark.com/product/amj96/)
8
9Make example for this keyboard (after setting up your build environment):
10
11 make amj96:default
12
13See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
14
15## Notes
16- In-switch and underglow LEDs currently not supported.
diff --git a/keyboards/amj96/rules.mk b/keyboards/amj96/rules.mk
new file mode 100644
index 000000000..3421d5820
--- /dev/null
+++ b/keyboards/amj96/rules.mk
@@ -0,0 +1,72 @@
1# MCU name
2#MCU = at90usb1286
3MCU = atmega32u4
4
5# Processor frequency.
6# This will define a symbol, F_CPU, in all source code files equal to the
7# processor frequency in Hz. You can then use this symbol in your source code to
8# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
9# automatically to create a 32-bit value in your source code.
10#
11# This will be an integer division of F_USB below, as it is sourced by
12# F_USB after it has run through any CPU prescalers. Note that this value
13# does not *change* the processor frequency - it should merely be updated to
14# reflect the processor speed set externally so that the code can use accurate
15# software delays.
16F_CPU = 16000000
17
18
19#
20# LUFA specific
21#
22# Target architecture (see library "Board Types" documentation).
23ARCH = 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.
36F_USB = $(F_CPU)
37
38# Interrupt driven control endpoint task(+60)
39OPT_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
48OPT_DEFS += -DBOOTLOADER_SIZE=4096
49
50
51# Build Options
52# change yes to no to disable
53#
54BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
55MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
56EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
57CONSOLE_ENABLE = yes # Console for debug(+400)
58COMMAND_ENABLE = yes # Commands for debug and configuration
59# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
60SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
61# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
62NKRO_ENABLE ?= yes # USB Nkey Rollover
63# BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default
64RGBLIGHT_ENABLE = yes
65MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
66UNICODE_ENABLE = no # Unicode
67BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
68AUDIO_ENABLE = no # Audio output on port C6
69FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
70
71CUSTOM_MATRIX = yes
72SRC += matrix.c