aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Young <18669334+noroadsleft@users.noreply.github.com>2021-02-13 23:17:05 -0800
committerGitHub <noreply@github.com>2021-02-13 23:17:05 -0800
commitecbbdbcd4e585a9a6b2b47d1dd8e1e3e1d50a254 (patch)
tree7702dd0bca35bedf5d9417f146e2c66ce27b7a8a
parentd035bb51f42909f2b866c2986f2f765ec2586328 (diff)
downloadqmk_firmware-ecbbdbcd4e585a9a6b2b47d1dd8e1e3e1d50a254.tar.gz
qmk_firmware-ecbbdbcd4e585a9a6b2b47d1dd8e1e3e1d50a254.zip
[Keyboard] YMDK YMD40 v2 (#11835)
* [Keyboard] YMDK YMD40 v2 * fork default keymap into default and factory - factory keymap is as assigned by the extracted JSON provided by the vendor - default keymap is based on the Planck * add AUDIO_SUPPORTED rule per drashna * modify factory keymap's readme Recommend users copy the default keymap instead.
-rw-r--r--keyboards/ymdk/ymd40/v2/config.h71
-rw-r--r--keyboards/ymdk/ymd40/v2/info.json64
-rw-r--r--keyboards/ymdk/ymd40/v2/keymaps/default/keymap.c55
-rw-r--r--keyboards/ymdk/ymd40/v2/keymaps/default/readme.md1
-rw-r--r--keyboards/ymdk/ymd40/v2/keymaps/factory/keymap.c32
-rw-r--r--keyboards/ymdk/ymd40/v2/keymaps/factory/readme.md3
-rw-r--r--keyboards/ymdk/ymd40/v2/readme.md22
-rw-r--r--keyboards/ymdk/ymd40/v2/rules.mk28
-rw-r--r--keyboards/ymdk/ymd40/v2/v2.c17
-rw-r--r--keyboards/ymdk/ymd40/v2/v2.h31
10 files changed, 324 insertions, 0 deletions
diff --git a/keyboards/ymdk/ymd40/v2/config.h b/keyboards/ymdk/ymd40/v2/config.h
new file mode 100644
index 000000000..926333f4e
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/config.h
@@ -0,0 +1,71 @@
1/* Copyright 2021 James Young (@noroadsleft)
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 "config_common.h"
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0x594D // "YM"
23#define PRODUCT_ID 0x4440 // "D" + 40
24#define DEVICE_VER 0x0001
25#define MANUFACTURER YMDK
26#define PRODUCT YMD40 v2
27
28/* key matrix size */
29#define MATRIX_ROWS 4
30#define MATRIX_COLS 12
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#define MATRIX_ROW_PINS { D0, B3, B2, B1 }
43#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }
44
45#define DIODE_DIRECTION COL2ROW
46
47#define BACKLIGHT_PIN B6
48#define BACKLIGHT_BREATHING
49#define BACKLIGHT_LEVELS 3
50
51#if defined(RGBLIGHT_ENABLE)
52 #define RGB_DI_PIN E2
53 #define RGBLED_NUM 8
54 #define RGBLIGHT_HUE_STEP 8
55 #define RGBLIGHT_SAT_STEP 8
56 #define RGBLIGHT_VAL_STEP 8
57 #define RGBLIGHT_LIMIT_VAL 150 /* The maximum brightness level */
58 #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
59/*== all animations enable ==*/
60 #define RGBLIGHT_ANIMATIONS
61// /*== or choose animations ==*/
62// #define RGBLIGHT_EFFECT_BREATHING
63// #define RGBLIGHT_EFFECT_RAINBOW_MOOD
64// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
65// #define RGBLIGHT_EFFECT_SNAKE
66// #define RGBLIGHT_EFFECT_KNIGHT
67// #define RGBLIGHT_EFFECT_CHRISTMAS
68// #define RGBLIGHT_EFFECT_STATIC_GRADIENT
69// #define RGBLIGHT_EFFECT_RGB_TEST
70// #define RGBLIGHT_EFFECT_ALTERNATING
71#endif
diff --git a/keyboards/ymdk/ymd40/v2/info.json b/keyboards/ymdk/ymd40/v2/info.json
new file mode 100644
index 000000000..7bb677e20
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/info.json
@@ -0,0 +1,64 @@
1{
2 "keyboard_name": "ymd40v2",
3 "url": "",
4 "maintainer": "qmk",
5 "width": 12,
6 "height": 4,
7 "layouts": {
8 "LAYOUT_ortho_4x12": {
9 "layout": [
10 {"label":"K00 (D0,F1)", "x":0, "y":0},
11 {"label":"K01 (D0,F0)", "x":1, "y":0},
12 {"label":"K02 (D0,B0)", "x":2, "y":0},
13 {"label":"K03 (D0,C7)", "x":3, "y":0},
14 {"label":"K04 (D0,F4)", "x":4, "y":0},
15 {"label":"K05 (D0,F5)", "x":5, "y":0},
16 {"label":"K06 (D0,F6)", "x":6, "y":0},
17 {"label":"K07 (D0,F7)", "x":7, "y":0},
18 {"label":"K08 (D0,D4)", "x":8, "y":0},
19 {"label":"K09 (D0,D6)", "x":9, "y":0},
20 {"label":"K0A (D0,B4)", "x":10, "y":0},
21 {"label":"K0B (D0,D7)", "x":11, "y":0},
22
23 {"label":"K10 (B3,F1)", "x":0, "y":1},
24 {"label":"K11 (B3,F0)", "x":1, "y":1},
25 {"label":"K12 (B3,B0)", "x":2, "y":1},
26 {"label":"K13 (B3,C7)", "x":3, "y":1},
27 {"label":"K14 (B3,F4)", "x":4, "y":1},
28 {"label":"K15 (B3,F5)", "x":5, "y":1},
29 {"label":"K16 (B3,F6)", "x":6, "y":1},
30 {"label":"K17 (B3,F7)", "x":7, "y":1},
31 {"label":"K18 (B3,D4)", "x":8, "y":1},
32 {"label":"K19 (B3,D6)", "x":9, "y":1},
33 {"label":"K1A (B3,B4)", "x":10, "y":1},
34 {"label":"K1B (B3,D7)", "x":11, "y":1},
35
36 {"label":"K20 (B2,F1)", "x":0, "y":2},
37 {"label":"K21 (B2,F0)", "x":1, "y":2},
38 {"label":"K22 (B2,B0)", "x":2, "y":2},
39 {"label":"K23 (B2,C7)", "x":3, "y":2},
40 {"label":"K24 (B2,F4)", "x":4, "y":2},
41 {"label":"K25 (B2,F5)", "x":5, "y":2},
42 {"label":"K26 (B2,F6)", "x":6, "y":2},
43 {"label":"K27 (B2,F7)", "x":7, "y":2},
44 {"label":"K28 (B2,D4)", "x":8, "y":2},
45 {"label":"K29 (B2,D6)", "x":9, "y":2},
46 {"label":"K2A (B2,B4)", "x":10, "y":2},
47 {"label":"K2B (B2,D7)", "x":11, "y":2},
48
49 {"label":"K30 (B1,F1)", "x":0, "y":3},
50 {"label":"K31 (B1,F0)", "x":1, "y":3},
51 {"label":"K32 (B1,B0)", "x":2, "y":3},
52 {"label":"K33 (B1,C7)", "x":3, "y":3},
53 {"label":"K34 (B1,F4)", "x":4, "y":3},
54 {"label":"K35 (B1,F5)", "x":5, "y":3},
55 {"label":"K36 (B1,F6)", "x":6, "y":3},
56 {"label":"K37 (B1,F7)", "x":7, "y":3},
57 {"label":"K38 (B1,D4)", "x":8, "y":3},
58 {"label":"K39 (B1,D6)", "x":9, "y":3},
59 {"label":"K3A (B1,B4)", "x":10, "y":3},
60 {"label":"K3B (B1,D7)", "x":11, "y":3}
61 ]
62 }
63 }
64}
diff --git a/keyboards/ymdk/ymd40/v2/keymaps/default/keymap.c b/keyboards/ymdk/ymd40/v2/keymaps/default/keymap.c
new file mode 100644
index 000000000..10d9385cf
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/keymaps/default/keymap.c
@@ -0,0 +1,55 @@
1/* Copyright 2021 James Young (@noroadsleft)
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 QMK_KEYBOARD_H
18
19enum layer_names {
20 _QWERTY,
21 _LOWER,
22 _RAISE,
23 _ADJUST
24};
25
26const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
27 [_QWERTY] = LAYOUT_ortho_4x12(
28 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
29 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
30 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
31 KC_CAPS, KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, KC_SPC, MO(2), KC_UP, KC_LEFT, KC_DOWN, KC_RGHT
32 ),
33 [_LOWER] = LAYOUT_ortho_4x12(
34 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
35 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
36 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
37 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
38 ),
39 [_RAISE] = LAYOUT_ortho_4x12(
40 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
41 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
42 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
43 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
44 ),
45 [_ADJUST] = LAYOUT_ortho_4x12(
46 RESET, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, DEBUG,
47 _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______,
48 _______, BL_TOGG, BL_DEC, BL_INC, BL_BRTG, _______, _______, _______, _______, _______, _______, _______,
49 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
50 )
51};
52
53layer_state_t layer_state_set_user(layer_state_t state) {
54 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
55}
diff --git a/keyboards/ymdk/ymd40/v2/keymaps/default/readme.md b/keyboards/ymdk/ymd40/v2/keymaps/default/readme.md
new file mode 100644
index 000000000..952866354
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for YMD40 v2
diff --git a/keyboards/ymdk/ymd40/v2/keymaps/factory/keymap.c b/keyboards/ymdk/ymd40/v2/keymaps/factory/keymap.c
new file mode 100644
index 000000000..3c7de8bc6
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/keymaps/factory/keymap.c
@@ -0,0 +1,32 @@
1/* Copyright 2021 James Young (@noroadsleft)
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 QMK_KEYBOARD_H
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 [0] = LAYOUT_ortho_4x12(
21 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
22 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
23 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
24 KC_CAPS, KC_LCTL, KC_LALT, KC_LGUI, KC_DEL, KC_SPC, KC_SPC, RGB_MOD, KC_UP, KC_LEFT, KC_DOWN, KC_RGHT
25 ),
26 [1] = LAYOUT_ortho_4x12(
27 RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
28 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
29 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
30 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
31 ),
32};
diff --git a/keyboards/ymdk/ymd40/v2/keymaps/factory/readme.md b/keyboards/ymdk/ymd40/v2/keymaps/factory/readme.md
new file mode 100644
index 000000000..923396165
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/keymaps/factory/readme.md
@@ -0,0 +1,3 @@
1# The factory keymap for YMD40 v2
2
3This is the keymap assigned by the KBFirmware-format JSON file distributed by the vendor. This is included mainly for reference; if you wish to create your own keymap, the `default` keymap is a better starting point.
diff --git a/keyboards/ymdk/ymd40/v2/readme.md b/keyboards/ymdk/ymd40/v2/readme.md
new file mode 100644
index 000000000..153853c9f
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/readme.md
@@ -0,0 +1,22 @@
1# YMD40 v2
2
3![YMD40 v2](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/ymdk/ymd40/v2/ymdk_ymd40_v2_00.jpg)\
4[PCB photo](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/ymdk/ymd40/v2/ymdk_ymd40_v2_pcb.jpg)
5
6A 40% ortholinear keyboard with in-switch LED support, underglow, and USB Type C.
7
8* Keyboard Maintainer: [The QMK Community](https://github.com/qmk)
9* Hardware Supported: YMD40v2 PCB (ATmega32U4)
10* Hardware Availability: [AliExpress](https://www.aliexpress.com/i/32821953148.html), [ymdkey.com](https://ymdkey.com/collections/40-mini-diy/products/ymd40-v2-diy-kit-qmk-type-c-pcb-cnc-case-plate-for-40-mini-cute-mechanical-keyboard-similar-to-planck-layout)
11
12Make example for this keyboard (after setting up your build environment):
13
14 make ymdk/ymd40/v2:default
15
16Flashing example for this keyboard:
17
18 make ymdk/ymd40/v2:default:flash
19
20To reset the board into bootloader mode, hold the key at the top left of the keyboard while connecting the USB cable (also erases persistent settings).
21
22See 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/ymdk/ymd40/v2/rules.mk b/keyboards/ymdk/ymd40/v2/rules.mk
new file mode 100644
index 000000000..7c7c443c9
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/rules.mk
@@ -0,0 +1,28 @@
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 = yes # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23
24KEY_LOCK_ENABLE = no # Enable KC_LOCK support
25
26AUDIO_SUPPORTED = no
27
28LAYOUTS = ortho_4x12
diff --git a/keyboards/ymdk/ymd40/v2/v2.c b/keyboards/ymdk/ymd40/v2/v2.c
new file mode 100644
index 000000000..54450ccd1
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/v2.c
@@ -0,0 +1,17 @@
1/* Copyright 2021 James Young (@noroadsleft)
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 "v2.h"
diff --git a/keyboards/ymdk/ymd40/v2/v2.h b/keyboards/ymdk/ymd40/v2/v2.h
new file mode 100644
index 000000000..6d524e073
--- /dev/null
+++ b/keyboards/ymdk/ymd40/v2/v2.h
@@ -0,0 +1,31 @@
1/* Copyright 2021 James Young (@noroadsleft)
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#define LAYOUT_ortho_4x12( \
22 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
23 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
24 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
25 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
26) { \
27 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
28 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \
29 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \
30 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B }, \
31}