From 57f5cd3ca7903a8736f79d3d08a7dc6dc75793b3 Mon Sep 17 00:00:00 2001 From: Kenneth Aloysius Date: Tue, 21 May 2019 05:43:29 +0700 Subject: [PATCH] [Keyboard] YD60MQ support (#5911) * Keep ASCII art consistent with keymap * Possible fix for xyverz ortho keymap: define RGBLED_NUM * Update DZ60 keymap; TODO store old keymap under different directory? * Change RGUI to RALT because 7u spacebar is too long * Save old bottom row keymap * Update Iris keymap: replace backslash with grv * Add ortho_4x12 layout * Added Delete key to Iris keymap * Move delete key * Oh look a new keyboard * ortho4x12: get an adjust layer back * Remove jj40 keymap, add custom power draw #define * Set WhiteFox to advertise only 100mA of power draw * Update WhiteFox keymap * Update WF keymap (2) * Remove lets_split keymap, update community krusli keymap * Add #define for BACKLIGHT_LEVELS (unused) * Update Whitefox keymap * Add YD60 from auto-generated kbfirmware files * Bring files up to speed with new standards * Fix: KEYMAP -> LAYOUT * Fix keymap differences (DZ60 -> YD60) * Update keymap * Update README * Fix RShift position * Specify that the port is for the YD60MQ variant * Update keyboards/iris/keymaps/krusli/keymap.c Co-Authored-By: fauxpark * Fix Iris and Let's Split keymaps * Remove unused keymap file * Use #include QMK_KEYBOARD_H * Add atmel-dfu selection to yd60 * Rename dir to YD60MQ, update definitions * Use new convenience macros/functions for led_set_user * Use #pragma once * Change all ?= to = in rules.mk * Use pragma once for yd60mq.h * Take out DZ60 and Iris changes * Remove now-removed Iris folder * Revert adding ortho_4x12 * Revert on xyverz ortho_4x12 keymap * Undo deleting JJ40 keymap files * Don't revert beyond upstream jj40 state * Extra files from earlier commit is to be deleted * Remove WhiteFox keymap not in upstream yet * Re-add my Let's Split keymap * Revert keymap changes * Cleanup: indentation * Update keyboards/yd60mq/rules.mk Co-Authored-By: fauxpark * Update keyboards/yd60mq/rules.mk Co-Authored-By: fauxpark * Cleanup & move kb backlighting code to yd60mq.c * Update README, rename to lowercase * Update README: rename to lowercase * Update README with links and picture of PCB * Remove PREVENT_STUCK_MODIFIERS Co-Authored-By: Drashna Jaelre --- keyboards/yd60mq/config.h | 47 +++++++++++++++++ keyboards/yd60mq/keymaps/default/keymap.c | 25 ++++++++++ keyboards/yd60mq/keymaps/krusli/keymap.c | 19 +++++++ keyboards/yd60mq/readme.md | 20 ++++++++ keyboards/yd60mq/rules.mk | 61 +++++++++++++++++++++++ keyboards/yd60mq/yd60mq.c | 13 +++++ keyboards/yd60mq/yd60mq.h | 18 +++++++ 7 files changed, 203 insertions(+) create mode 100644 keyboards/yd60mq/config.h create mode 100644 keyboards/yd60mq/keymaps/default/keymap.c create mode 100644 keyboards/yd60mq/keymaps/krusli/keymap.c create mode 100644 keyboards/yd60mq/readme.md create mode 100644 keyboards/yd60mq/rules.mk create mode 100644 keyboards/yd60mq/yd60mq.c create mode 100644 keyboards/yd60mq/yd60mq.h diff --git a/keyboards/yd60mq/config.h b/keyboards/yd60mq/config.h new file mode 100644 index 000000000..2a899fa3e --- /dev/null +++ b/keyboards/yd60mq/config.h @@ -0,0 +1,47 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER YMDK +#define PRODUCT YD60MQ +#define DESCRIPTION Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, F7, B5, B4, D7, D6, B3, B2 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 5 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* prevent stuck modifiers */ + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + diff --git a/keyboards/yd60mq/keymaps/default/keymap.c b/keyboards/yd60mq/keymaps/default/keymap.c new file mode 100644 index 000000000..a5a0145ee --- /dev/null +++ b/keyboards/yd60mq/keymaps/default/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + 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, + 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_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, + 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, + KC_LCTL, KC_LGUI, KC_LALT, MO(1), KC_SPC, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + LAYOUT( + 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, + 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, + 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, BL_DEC, BL_TOGG, BL_INC, 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), + +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} diff --git a/keyboards/yd60mq/keymaps/krusli/keymap.c b/keyboards/yd60mq/keymaps/krusli/keymap.c new file mode 100644 index 000000000..d9c276565 --- /dev/null +++ b/keyboards/yd60mq/keymaps/krusli/keymap.c @@ -0,0 +1,19 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + 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, + 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_BSPC, + KC_LCTL, 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, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, KC_RSFT, MO(1), + KC_LCTL, KC_LALT, KC_LGUI, _______, KC_SPC, _______, _______, KC_RALT, _______, KC_RGUI, KC_RCTL), + + LAYOUT( + 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_INS, KC_DEL, + KC_CAPS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, RESET, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, _______, + _______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + +}; diff --git a/keyboards/yd60mq/readme.md b/keyboards/yd60mq/readme.md new file mode 100644 index 000000000..78f442d88 --- /dev/null +++ b/keyboards/yd60mq/readme.md @@ -0,0 +1,20 @@ +YD60MQ +====== + +![YD60MQ PCB](https://ae01.alicdn.com/kf/HTB1PVQ2X_HuK1RkSndVq6xVwpXaO.jpg) + +Customizable 60% PCB by [YMDK](https://ymdk.aliexpress.com/store/429151?spm=2114.10010108.0.0.3ab23641lIkgzm). + +Keyboard Maintainer: QMK Community +Hardware Supported: YD60MQ +Hardware 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) + +Make example for this keyboard (after setting up your build environment): + + make yd60mq:default + +The keyboard uses a DFU bootloader. To make a keymap and use dfu-util to flash it: + + make yd60mq:default:dfu + +See 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. diff --git a/keyboards/yd60mq/rules.mk b/keyboards/yd60mq/rules.mk new file mode 100644 index 000000000..2a8963011 --- /dev/null +++ b/keyboards/yd60mq/rules.mk @@ -0,0 +1,61 @@ +# MCU name +MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes diff --git a/keyboards/yd60mq/yd60mq.c b/keyboards/yd60mq/yd60mq.c new file mode 100644 index 000000000..96306d6a6 --- /dev/null +++ b/keyboards/yd60mq/yd60mq.c @@ -0,0 +1,13 @@ +#include "yd60mq.h" + +void led_set_kb(uint8_t usb_led) { + if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { + setPinOutput(F4); + writePinLow(F4); + } else { + setPinInput(F4); + writePinLow(F4); + } + + led_set_user(usb_led); +} diff --git a/keyboards/yd60mq/yd60mq.h b/keyboards/yd60mq/yd60mq.h new file mode 100644 index 000000000..5f5d8a242 --- /dev/null +++ b/keyboards/yd60mq/yd60mq.h @@ -0,0 +1,18 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K403, K407, K408, K409, K410, K411, K412, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, K403, KC_NO, KC_NO, KC_NO, K407, K408, K409, K410, K411, K412, K413, KC_NO } \ +} +