aboutsummaryrefslogtreecommitdiff
path: root/keyboards/yd60mq
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2020-03-05 07:26:25 +1100
committerGitHub <noreply@github.com>2020-03-05 07:26:25 +1100
commit607e2f6c310f2404933e791561912a0a35587aae (patch)
tree8eae614841491b53bf0383b16aa0ac38f76a0f85 /keyboards/yd60mq
parent2d1081c29638cd84428c40502ab35461403b107e (diff)
downloadqmk_firmware-607e2f6c310f2404933e791561912a0a35587aae.tar.gz
qmk_firmware-607e2f6c310f2404933e791561912a0a35587aae.zip
YD60MQ refactor and Configurator layout support (#8313)
* refactor yd60mq.h - four-space indent - use K<row><col> base32hex notation - rename LAYOUT to LAYOUT_all (with alias for backwards compatibility) * refactor yd60mq.c to use led_update_kb() * align rules.mk to AVR template * refactor default keymap Also correct positions for KC_NUHS and KC_NUBS. * update readme * add Configurator layout support * initialize the Caps Lock LED pin properly
Diffstat (limited to 'keyboards/yd60mq')
-rw-r--r--keyboards/yd60mq/info.json83
-rw-r--r--keyboards/yd60mq/keymaps/default/keymap.c32
-rw-r--r--keyboards/yd60mq/readme.md15
-rw-r--r--keyboards/yd60mq/rules.mk28
-rw-r--r--keyboards/yd60mq/yd60mq.c23
-rw-r--r--keyboards/yd60mq/yd60mq.h23
6 files changed, 148 insertions, 56 deletions
diff --git a/keyboards/yd60mq/info.json b/keyboards/yd60mq/info.json
new file mode 100644
index 000000000..79d5e9d98
--- /dev/null
+++ b/keyboards/yd60mq/info.json
@@ -0,0 +1,83 @@
1{
2 "keyboard_name": "YD60MQ",
3 "url": "",
4 "maintainer": "qmk",
5 "width": 15,
6 "height": 5,
7 "layouts": {
8 "LAYOUT_all": {
9 "key_count": 69,
10 "layout": [
11 {"label":"Esc", "x":0, "y":0},
12 {"label":"1", "x":1, "y":0},
13 {"label":"2", "x":2, "y":0},
14 {"label":"3", "x":3, "y":0},
15 {"label":"4", "x":4, "y":0},
16 {"label":"5", "x":5, "y":0},
17 {"label":"6", "x":6, "y":0},
18 {"label":"7", "x":7, "y":0},
19 {"label":"8", "x":8, "y":0},
20 {"label":"9", "x":9, "y":0},
21 {"label":"0", "x":10, "y":0},
22 {"label":"-", "x":11, "y":0},
23 {"label":"=", "x":12, "y":0},
24 {"label":"\\", "x":13, "y":0},
25 {"label":"`", "x":14, "y":0},
26 {"label":"Tab", "x":0, "y":1, "w":1.5},
27 {"label":"Q", "x":1.5, "y":1},
28 {"label":"W", "x":2.5, "y":1},
29 {"label":"E", "x":3.5, "y":1},
30 {"label":"R", "x":4.5, "y":1},
31 {"label":"T", "x":5.5, "y":1},
32 {"label":"Y", "x":6.5, "y":1},
33 {"label":"U", "x":7.5, "y":1},
34 {"label":"I", "x":8.5, "y":1},
35 {"label":"O", "x":9.5, "y":1},
36 {"label":"P", "x":10.5, "y":1},
37 {"label":"[", "x":11.5, "y":1},
38 {"label":"]", "x":12.5, "y":1},
39 {"label":"\\", "x":13.5, "y":1, "w":1.5},
40 {"label":"Caps", "x":0, "y":2, "w":1.75},
41 {"label":"A", "x":1.75, "y":2},
42 {"label":"S", "x":2.75, "y":2},
43 {"label":"D", "x":3.75, "y":2},
44 {"label":"F", "x":4.75, "y":2},
45 {"label":"G", "x":5.75, "y":2},
46 {"label":"H", "x":6.75, "y":2},
47 {"label":"J", "x":7.75, "y":2},
48 {"label":"K", "x":8.75, "y":2},
49 {"label":"L", "x":9.75, "y":2},
50 {"label":";", "x":10.75, "y":2},
51 {"label":"\"", "x":11.75, "y":2},
52 {"label":"ISO Hash", "x":12.75, "y":2},
53 {"label":"Enter", "x":13.75, "y":2, "w":1.25},
54 {"label":"Shift", "x":0, "y":3},
55 {"label":"ISO \\", "x":1, "y":3},
56 {"label":"Z", "x":2, "y":3},
57 {"label":"X", "x":3, "y":3},
58 {"label":"C", "x":4, "y":3},
59 {"label":"V", "x":5, "y":3},
60 {"label":"B", "x":6, "y":3},
61 {"label":"N", "x":7, "y":3},
62 {"label":"M", "x":8, "y":3},
63 {"label":",", "x":9, "y":3},
64 {"label":".", "x":10, "y":3},
65 {"label":"/", "x":11, "y":3},
66 {"label":"Shift", "x":12, "y":3},
67 {"label":"Up", "x":13, "y":3},
68 {"label":"Del", "x":14, "y":3},
69 {"label":"Ctrl", "x":0, "y":4, "w":1.25},
70 {"label":"GUI", "x":1.25, "y":4, "w":1.25},
71 {"label":"Alt", "x":2.5, "y":4, "w":1.25},
72 {"label":"MO(1)", "x":3.75, "y":4, "w":2.25},
73 {"label":"Space", "x":6, "y":4, "w":1.25},
74 {"label":"MO(1)", "x":7.25, "y":4, "w":2.75},
75 {"label":"Alt", "x":10, "y":4},
76 {"label":"Ctrl", "x":11, "y":4},
77 {"label":"Left", "x":12, "y":4},
78 {"label":"Down", "x":13, "y":4},
79 {"label":"Right", "x":14, "y":4}
80 ]
81 }
82 }
83}
diff --git a/keyboards/yd60mq/keymaps/default/keymap.c b/keyboards/yd60mq/keymaps/default/keymap.c
index a5a0145ee..2ba441626 100644
--- a/keyboards/yd60mq/keymaps/default/keymap.c
+++ b/keyboards/yd60mq/keymaps/default/keymap.c
@@ -2,24 +2,20 @@
2 2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 4
5 LAYOUT( 5 [0] = LAYOUT_all(
6 KC_ESC, 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_BSLS, KC_GRV, 6 KC_ESC, 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_BSLS, KC_GRV,
7 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, 7 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,
8 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_BSLS, KC_ENT, 8 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,
9 KC_LSFT, KC_NUHS, 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_DEL, 9 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_DEL,
10 KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), 10 KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
11 ),
11 12
12 LAYOUT( 13 [1] = LAYOUT_all(
13 RESET, 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_DEL, 14 RESET, 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_DEL,
14 KC_TRNS, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 15 _______, RGB_TOG, KC_UP, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______,
15 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, 16 _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
16 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 17 _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______,
17 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), 18 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
19 ),
18 20
19}; 21};
20
21void matrix_init_user(void) {
22}
23
24void matrix_scan_user(void) {
25}
diff --git a/keyboards/yd60mq/readme.md b/keyboards/yd60mq/readme.md
index 78f442d88..0802c9d16 100644
--- a/keyboards/yd60mq/readme.md
+++ b/keyboards/yd60mq/readme.md
@@ -1,20 +1,19 @@
1YD60MQ 1# YD60MQ
2======
3 2
4![YD60MQ PCB](https://ae01.alicdn.com/kf/HTB1PVQ2X_HuK1RkSndVq6xVwpXaO.jpg) 3![YD60MQ PCB](https://ae01.alicdn.com/kf/HTB1PVQ2X_HuK1RkSndVq6xVwpXaO.jpg)
5 4
6Customizable 60% PCB by [YMDK](https://ymdk.aliexpress.com/store/429151?spm=2114.10010108.0.0.3ab23641lIkgzm). 5Customizable 60% PCB by [YMDK](https://ymdk.aliexpress.com/store/429151?spm=2114.10010108.0.0.3ab23641lIkgzm).
7 6
8Keyboard Maintainer: QMK Community 7* Keyboard Maintainer: QMK Community
9Hardware Supported: YD60MQ 8* Hardware Supported: YD60MQ PCB, ATmega32U4
10Hardware Availability: YMDK - [AliExpress](https://www.aliexpress.com/item/YMDK-60-YD60MQ-QMK-Programmable-Underglow-RGB-Led-PCB-Plate-Stabilizers-For-DIY-Mechanical-Keyboard-Interchange/32869207240.html) 9* Hardware Availability: [YMDK on AliExpress](https://www.aliexpress.com/i/32869207240.html)
11 10
12Make example for this keyboard (after setting up your build environment): 11Make example for this keyboard (after setting up your build environment):
13 12
14 make yd60mq:default 13 make yd60mq:default
15 14
16The keyboard uses a DFU bootloader. To make a keymap and use dfu-util to flash it: 15The keyboard uses a DFU bootloader. To make a keymap and use dfu to flash it:
17 16
18 make yd60mq:default:dfu 17 make yd60mq:default:flash
19 18
20See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. 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/yd60mq/rules.mk b/keyboards/yd60mq/rules.mk
index c1f1f22ba..5159ae59f 100644
--- a/keyboards/yd60mq/rules.mk
+++ b/keyboards/yd60mq/rules.mk
@@ -12,15 +12,21 @@ MCU = atmega32u4
12BOOTLOADER = atmel-dfu 12BOOTLOADER = atmel-dfu
13 13
14# Build Options 14# Build Options
15# comment out to disable the options. 15# change yes to no to disable
16# 16#
17BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration 17BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys 18MOUSEKEY_ENABLE = yes # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control 19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = no # Console for debug 20CONSOLE_ENABLE = no # Console for debug
21COMMAND_ENABLE = no # Commands for debug and configuration 21COMMAND_ENABLE = no # Commands for debug and configuration
22SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work 23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality 24# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25AUDIO_ENABLE = no 25NKRO_ENABLE = yes # USB Nkey Rollover
26RGBLIGHT_ENABLE = yes 26BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
27RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
28MIDI_ENABLE = no # MIDI support
29BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
30AUDIO_ENABLE = no # Audio output on port C6
31FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
32HD44780_ENABLE = no # Enable support for HD44780 based LCDs
diff --git a/keyboards/yd60mq/yd60mq.c b/keyboards/yd60mq/yd60mq.c
index 6e391046e..a39af530d 100644
--- a/keyboards/yd60mq/yd60mq.c
+++ b/keyboards/yd60mq/yd60mq.c
@@ -1,12 +1,19 @@
1#include "yd60mq.h" 1#include "yd60mq.h"
2 2
3void led_set_kb(uint8_t usb_led) { 3void matrix_init_kb(void){
4 if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { 4 setPinOutput(F4);
5 setPinOutput(F4); 5 writePinHigh(F4);
6 writePinLow(F4); 6}
7 } else {
8 setPinInput(F4);
9 }
10 7
11 led_set_user(usb_led); 8bool led_update_kb(led_t led_state) {
9 bool res = led_update_user(led_state);
10 if (res) {
11 // writePin sets the pin high for 1 and low for 0.
12 // In this example the pins are inverted, setting
13 // it low/0 turns it on, and high/1 turns the LED off.
14 // This behavior depends on whether the LED is between the pin
15 // and VCC or the pin and GND.
16 writePin(F4, !led_state.caps_lock);
17 }
18 return res;
12} 19}
diff --git a/keyboards/yd60mq/yd60mq.h b/keyboards/yd60mq/yd60mq.h
index 5f5d8a242..850cf8d22 100644
--- a/keyboards/yd60mq/yd60mq.h
+++ b/keyboards/yd60mq/yd60mq.h
@@ -2,17 +2,18 @@
2 2
3#include "quantum.h" 3#include "quantum.h"
4 4
5#define LAYOUT( \ 5#define LAYOUT_all( \
6 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ 6 K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
7 K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ 7 K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
8 K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ 8 K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
9 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ 9 K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
10 K400, K401, K402, K403, K407, K408, K409, K410, K411, K412, K413 \ 10 K40, K41, K42, K43, K47, K48, K49, K4A, K4B, K4C, K4D \
11) { \ 11) { \
12 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ 12 { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \
13 { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ 13 { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO }, \
14 { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ 14 { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \
15 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ 15 { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \
16 { K400, K401, K402, K403, KC_NO, KC_NO, KC_NO, K407, K408, K409, K410, K411, K412, K413, KC_NO } \ 16 { K40, K41, K42, K43, KC_NO, KC_NO, KC_NO, K47, K48, K49, K4A, K4B, K4C, K4D, KC_NO } \
17} 17}
18 18
19#define LAYOUT LAYOUT_all