~ruther/qmk_firmware

c1e008b0520a983226622af21e82d7ebe24b83f3 — James Young 3 years ago 97d0e7c
[Keyboard] add YMDK YMD21 v2 (#16442)

* [Keyboard] add YMDK YMD21 v2

* remove trailing whitespace from default keymap
A keyboards/ymdk/ymd21/v2/config.h => keyboards/ymdk/ymd21/v2/config.h +71 -0
@@ 0,0 1,71 @@
/* Copyright 2022 QMK / James Young (@noroadsleft)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID       0x45D4
#define PRODUCT_ID      0x0110
#define DEVICE_VER      0x0001
#define MANUFACTURER    YMDK
#define PRODUCT         YMD21 v2

/* key matrix size */
#define MATRIX_ROWS 6
#define MATRIX_COLS 4

/*
 * Keyboard Matrix Assignments
 *
 * Change this to how you wired your keyboard
 * COLS: AVR pins used for columns, left to right
 * ROWS: AVR pins used for rows, top to bottom
 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
 *                  ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
 *
 */
#define MATRIX_ROW_PINS { B3, B6, B2, B1, D7, B4 }
#define MATRIX_COL_PINS { F5, F4, D3, D2 }

#define DIODE_DIRECTION ROW2COL

#define BACKLIGHT_PIN B7
#define BACKLIGHT_BREATHING
#define BACKLIGHT_LEVELS 3

#define RGB_DI_PIN E2
#if defined(RGBLIGHT_ENABLE)
    #define RGBLED_NUM 8
    #define RGBLIGHT_HUE_STEP 8
    #define RGBLIGHT_SAT_STEP 8
    #define RGBLIGHT_VAL_STEP 8
    #define RGBLIGHT_LIMIT_VAL 180 /* The maximum brightness level */
    #define RGBLIGHT_SLEEP  /* If defined, the RGB lighting will be switched off when the host goes to sleep */
/*== all animations enable ==*/
    #define RGBLIGHT_ANIMATIONS
// /*== or choose animations ==*/
//     #define RGBLIGHT_EFFECT_BREATHING
//     #define RGBLIGHT_EFFECT_RAINBOW_MOOD
//     #define RGBLIGHT_EFFECT_RAINBOW_SWIRL
//     #define RGBLIGHT_EFFECT_SNAKE
//     #define RGBLIGHT_EFFECT_KNIGHT
//     #define RGBLIGHT_EFFECT_CHRISTMAS
//     #define RGBLIGHT_EFFECT_STATIC_GRADIENT
//     #define RGBLIGHT_EFFECT_RGB_TEST
//     #define RGBLIGHT_EFFECT_ALTERNATING
#endif

A keyboards/ymdk/ymd21/v2/info.json => keyboards/ymdk/ymd21/v2/info.json +40 -0
@@ 0,0 1,40 @@
{
    "keyboard_name": "YMD21 v2",
    "url": "",
    "maintainer": "qmk",
    "layouts": {
        "LAYOUT_ortho_6x4": {
            "layout": [
                {"label":"F1", "x":0, "y":0},
                {"label":"F2", "x":1, "y":0},
                {"label":"F3", "x":2, "y":0},
                {"label":"F4", "x":3, "y":0},

                {"label":"Num Lock", "x":0, "y":1.25},
                {"label":"/", "x":1, "y":1.25},
                {"label":"*", "x":2, "y":1.25},
                {"label":"-", "x":3, "y":1.25},

                {"label":"7", "x":0, "y":2.25},
                {"label":"8", "x":1, "y":2.25},
                {"label":"9", "x":2, "y":2.25},
                {"label":"=", "x":3, "y":2.25},

                {"label":"4", "x":0, "y":3.25},
                {"label":"5", "x":1, "y":3.25},
                {"label":"6", "x":2, "y":3.25},
                {"label":"+", "x":3, "y":3.25},

                {"label":"1", "x":0, "y":4.25},
                {"label":"2", "x":1, "y":4.25},
                {"label":"3", "x":2, "y":4.25},
                {"label":"Space", "x":3, "y":4.25},

                {"label":"Fn", "x":0, "y":5.25},
                {"label":"0", "x":1, "y":5.25},
                {"label":".", "x":2, "y":5.25},
                {"label":"Enter", "x":3, "y":5.25}
            ]
        }
    }
}

A keyboards/ymdk/ymd21/v2/keymaps/default/keymap.c => keyboards/ymdk/ymd21/v2/keymaps/default/keymap.c +39 -0
@@ 0,0 1,39 @@
/* Copyright 2022 QMK / James Young (@noroadsleft)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

    [0] = LAYOUT_ortho_6x4(
        KC_F1,   KC_F2,   KC_F3,   KC_F4,
        KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
        KC_P7,   KC_P8,   KC_P9,   KC_PEQL,
        KC_P4,   KC_P5,   KC_P6,   KC_PPLS,
        KC_P1,   KC_P2,   KC_P3,   KC_SPC,
        MO(1),   KC_P0,   KC_PDOT, KC_PENT
    ),

    [1] = LAYOUT_ortho_6x4(
        RGB_MOD, BL_STEP, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______,
        _______, _______, _______, _______
    ),

};

A keyboards/ymdk/ymd21/v2/readme.md => keyboards/ymdk/ymd21/v2/readme.md +27 -0
@@ 0,0 1,27 @@
# YMDK YMD21 v2

![YMDK YMD21 v2](https://raw.githubusercontent.com/noroadsleft/qmk_images/master/keyboards/ymdk/ymd21/v2/New-YMD21-V2-QMK-VIA-21-23-24-Key-RGB-Programmable-Marco-Function-MX-Cherry-Gateron.jpg_Q90.jpg_1_640.jpg)

A 21-to-24-key numpad with RGB Underglow, USB-C, and support for in-switch LEDs.

* Keyboard Maintainer: [The QMK Community](https://github.com/qmk)
* Hardware Supported: YMDK YMD21 v2 (ATmega32U4)
* Hardware Availability: [YMDKey.com](https://ymdkey.com/collections/num-pad-diy/products/new-ymd21-v2-qmk-via-21-23-24-key-rgb-programmable-marco-function-mx-cherry-gateron-switches-numpad-for-lol-battlegrounds), [AliExpress](https://www.aliexpress.com/item/32916152785.html)

Make example for this keyboard (after setting up your build environment):

    make ymdk/ymd21/v2:default

Flashing example for this keyboard:

    make ymdk/ymd21/v2:default:flash

## Bootloader

Enter the bootloader using one of the following methods:

* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB
* **Keycode in layout**: Press the key mapped to `RESET` if it is available

See 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).

A keyboards/ymdk/ymd21/v2/rules.mk => keyboards/ymdk/ymd21/v2/rules.mk +20 -0
@@ 0,0 1,20 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
BOOTLOADER = atmel-dfu

# Build Options
#   change yes to no to disable
#
BOOTMAGIC_ENABLE = yes      # Enable Bootmagic Lite
MOUSEKEY_ENABLE = yes       # Mouse keys
EXTRAKEY_ENABLE = yes       # Audio control and System control
CONSOLE_ENABLE = no         # Console for debug
COMMAND_ENABLE = no         # Commands for debug and configuration
NKRO_ENABLE = no            # Enable N-Key Rollover
BACKLIGHT_ENABLE = yes      # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes       # Enable keyboard RGB underglow
AUDIO_ENABLE = no           # Audio output

LAYOUTS = ortho_6x4

A keyboards/ymdk/ymd21/v2/v2.c => keyboards/ymdk/ymd21/v2/v2.c +17 -0
@@ 0,0 1,17 @@
/* Copyright 2022 QMK / James Young (@noroadsleft)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "v2.h"

A keyboards/ymdk/ymd21/v2/v2.h => keyboards/ymdk/ymd21/v2/v2.h +58 -0
@@ 0,0 1,58 @@
/* Copyright 2022 QMK / James Young (@noroadsleft)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include "quantum.h"

#define XXX KC_NO

/*
 * ┌───┬───┬───┬───┐
 * │00 │01 │02 │03 │
 * └───┴───┴───┴───┘
 * ┌───┬───┬───┬───┐
 * │10 │11 │12 │13 │
 * ├───┼───┼───┼───┤   ┌───┐
 * │20 │21 │22 │23 │   │   │
 * ├───┼───┼───┼───┤   │?? │ 2u Plus
 * │30 │31 │32 │33 │   │   │
 * ├───┼───┼───┼───┤   ├───┤
 * │40 │41 │42 │43 │   │   │
 * ├───┼───┼───┼───┤   │?? │ 2u Enter
 * │50 │51 │52 │53 │   │   │
 * └───┴───┴───┴───┘   └───┘
 * ┌───────┐
 * │??     │ 2u 0
 * └───────┘
 */


#define LAYOUT_ortho_6x4( \
    K00, K01, K02, K03, \
    K10, K11, K12, K13, \
    K20, K21, K22, K23, \
    K30, K31, K32, K33, \
    K40, K41, K42, K43, \
    K50, K51, K52, K53  \
) { \
    { K00, K01, K02, K03 }, \
    { K10, K11, K12, K13 }, \
    { K20, K21, K22, K23 }, \
    { K30, K31, K32, K33 }, \
    { K40, K41, K42, K43 }, \
    { K50, K51, K52, K53 }, \
}