diff --git a/keyboards/moky/moky88/config.h b/keyboards/moky/moky88/config.h new file mode 100644 index 0000000000..a673a38069 --- /dev/null +++ b/keyboards/moky/moky88/config.h @@ -0,0 +1,19 @@ +// Copyright 2023 VertorWang (@itarze) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +/* SPI */ +#define SPI_DRIVER SPIDQ +#define SPI_SCK_PIN B3 +#define SPI_MOSI_PIN B5 +#define SPI_MISO_PIN B4 + +/* Flash */ +#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN C12 + +/* RGB Driver */ +#define AW20216S_CS_PIN_1 D2 +#define AW20216S_CS_PIN_2 B8 +#define AW20216S_EN_PIN_1 B9 +#define AW20216S_EN_PIN_2 B9 diff --git a/keyboards/moky/moky88/halconf.h b/keyboards/moky/moky88/halconf.h new file mode 100644 index 0000000000..0a59a1fcb8 --- /dev/null +++ b/keyboards/moky/moky88/halconf.h @@ -0,0 +1,10 @@ +// Copyright 2023 VertorWang (@itarze) +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define HAL_USE_SPI TRUE +#define SPI_USE_WAIT TRUE +#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD + +#include_next diff --git a/keyboards/moky/moky88/info.json b/keyboards/moky/moky88/info.json new file mode 100644 index 0000000000..79d5373ea8 --- /dev/null +++ b/keyboards/moky/moky88/info.json @@ -0,0 +1,272 @@ +{ + "manufacturer": "moky", + "keyboard_name": "moky88", + "url": "", + "processor": "WB32FQ95", + "bootloader": "wb32-dfu", + "usb": { + "device_version": "1.0.0", + "vid": "0xBB4F", + "pid": "0x0001", + "suspend_wakeup_delay": 1000 + }, + "diode_direction": "ROW2COL", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "rgb_matrix": true, + "encoder": true + }, + "matrix_pins": { + "cols": ["C0", "C1", "C2", "C3", "A6", "B10", "B11", "B12", "B13", "B14", "B15", "C6", "C7", "C8", "C9", "A8", "C4"], + "rows": ["A0", "A1", "A2", "A3", "A4", "C13"] + }, + "eeprom": { + "wear_leveling": { + "backing_size": 4096, + "driver": "spi_flash" + } + }, + "encoder": { + "rotary": [ + {"pin_a": "B6", "pin_b": "B7"} + ] + }, + "rgb_matrix": { + "driver": "aw20216", + "max_brightness": 108, + "animations": { + "alphas_mods": true, + "gradient_up_down": true, + "gradient_left_right": true, + "breathing": true, + "band_sat": true, + "band_val": true, + "band_pinwheel_sat": true, + "band_pinwheel_val": true, + "band_spiral_sat": true, + "band_spiral_val": true, + "cycle_all": true, + "cycle_left_right": true, + "cycle_up_down": true, + "cycle_out_in": true, + "cycle_out_in_dual": true, + "rainbow_moving_chevron": true, + "cycle_pinwheel": true, + "cycle_spiral": true, + "dual_beacon": true, + "rainbow_beacon": true, + "rainbow_pinwheels": true, + "raindrops": true, + "jellybean_raindrops": true, + "hue_breathing": true, + "hue_pendulum": true, + "hue_wave": true, + "pixel_fractal": true, + "pixel_flow": true, + "pixel_rain": true, + "typing_heatmap": true, + "digital_rain": true, + "solid_reactive_simple": true, + "solid_reactive": true, + "solid_reactive_wide": true, + "solid_reactive_multiwide": true, + "solid_reactive_cross": true, + "solid_reactive_multicross": true, + "solid_reactive_nexus": true, + "solid_reactive_multinexus": true, + "splash": true, + "multisplash": true, + "solid_splash": true, + "solid_multisplash": true + }, + "layout": [ + {"flags": 4, "matrix": [0, 0], "x": 0 , "y": 0}, + {"flags": 4, "matrix": [0, 1], "x": 14 , "y": 0}, + {"flags": 4, "matrix": [0, 2], "x": 28 , "y": 0}, + {"flags": 4, "matrix": [0, 3], "x": 42 , "y": 0}, + {"flags": 4, "matrix": [0, 4], "x": 56 , "y": 0}, + {"flags": 4, "matrix": [0, 5], "x": 70 , "y": 0}, + {"flags": 4, "matrix": [0, 6], "x": 84 , "y": 0}, + {"flags": 4, "matrix": [0, 7], "x": 98 , "y": 0}, + {"flags": 4, "matrix": [0, 8], "x": 112, "y": 0}, + {"flags": 4, "matrix": [0, 9], "x": 126, "y": 0}, + {"flags": 4, "matrix": [0,10], "x": 140, "y": 0}, + {"flags": 4, "matrix": [0,11], "x": 154, "y": 0}, + {"flags": 4, "matrix": [0,12], "x": 168, "y": 0}, + {"flags": 4, "matrix": [0,13], "x": 182, "y": 0}, + {"flags": 4, "matrix": [0,14], "x": 196, "y": 0}, + {"flags": 4, "matrix": [0,15], "x": 210, "y": 0}, + {"flags": 4, "matrix": [0,16], "x": 224, "y": 0}, + {"flags": 4, "matrix": [1, 0], "x": 0 , "y": 13}, + {"flags": 4, "matrix": [1, 1], "x": 14 , "y": 13}, + {"flags": 4, "matrix": [1, 2], "x": 28 , "y": 13}, + {"flags": 4, "matrix": [1, 3], "x": 42 , "y": 13}, + {"flags": 4, "matrix": [1, 4], "x": 56 , "y": 13}, + {"flags": 4, "matrix": [1, 5], "x": 70 , "y": 13}, + {"flags": 4, "matrix": [1, 6], "x": 84 , "y": 13}, + {"flags": 4, "matrix": [1, 7], "x": 98 , "y": 13}, + {"flags": 4, "matrix": [1, 8], "x": 112, "y": 13}, + {"flags": 4, "matrix": [1, 9], "x": 126, "y": 13}, + {"flags": 4, "matrix": [1,10], "x": 140, "y": 13}, + {"flags": 4, "matrix": [1,11], "x": 154, "y": 13}, + {"flags": 4, "matrix": [1,12], "x": 168, "y": 13}, + {"flags": 4, "matrix": [1,13], "x": 182, "y": 13}, + {"flags": 4, "matrix": [1,14], "x": 196, "y": 13}, + {"flags": 4, "matrix": [1,15], "x": 210, "y": 13}, + {"flags": 4, "matrix": [1,16], "x": 224, "y": 13}, + {"flags": 4, "matrix": [2, 0], "x": 0 , "y": 26}, + {"flags": 4, "matrix": [2, 1], "x": 14 , "y": 26}, + {"flags": 4, "matrix": [2, 2], "x": 28 , "y": 26}, + {"flags": 4, "matrix": [2, 3], "x": 42 , "y": 26}, + {"flags": 4, "matrix": [2, 4], "x": 56 , "y": 26}, + {"flags": 4, "matrix": [2, 5], "x": 70 , "y": 26}, + {"flags": 4, "matrix": [2, 6], "x": 84 , "y": 26}, + {"flags": 4, "matrix": [2, 7], "x": 98 , "y": 26}, + {"flags": 4, "matrix": [2, 8], "x": 112, "y": 26}, + {"flags": 4, "matrix": [2, 9], "x": 126, "y": 26}, + {"flags": 4, "matrix": [2,10], "x": 140, "y": 26}, + {"flags": 4, "matrix": [2,11], "x": 154, "y": 26}, + {"flags": 4, "matrix": [2,12], "x": 168, "y": 26}, + {"flags": 4, "matrix": [2,13], "x": 182, "y": 26}, + {"flags": 4, "matrix": [2,14], "x": 196, "y": 26}, + {"flags": 4, "matrix": [2,15], "x": 210, "y": 26}, + {"flags": 4, "matrix": [2,16], "x": 224, "y": 26}, + {"flags": 4, "matrix": [3, 0], "x": 0 , "y": 39}, + {"flags": 4, "matrix": [3, 1], "x": 14 , "y": 39}, + {"flags": 4, "matrix": [3, 2], "x": 28 , "y": 39}, + {"flags": 4, "matrix": [3, 3], "x": 42 , "y": 39}, + {"flags": 4, "matrix": [3, 4], "x": 56 , "y": 39}, + {"flags": 4, "matrix": [3, 5], "x": 70 , "y": 39}, + {"flags": 4, "matrix": [3, 6], "x": 84 , "y": 39}, + {"flags": 4, "matrix": [3, 7], "x": 98 , "y": 39}, + {"flags": 4, "matrix": [3, 8], "x": 112, "y": 39}, + {"flags": 4, "matrix": [3, 9], "x": 126, "y": 39}, + {"flags": 4, "matrix": [3,10], "x": 140, "y": 39}, + {"flags": 4, "matrix": [3,11], "x": 154, "y": 39}, + {"flags": 4, "matrix": [3,13], "x": 182, "y": 39}, + {"flags": 4, "matrix": [4, 0], "x": 0 , "y": 52}, + {"flags": 4, "matrix": [4, 2], "x": 28 , "y": 52}, + {"flags": 4, "matrix": [4, 3], "x": 42 , "y": 52}, + {"flags": 4, "matrix": [4, 4], "x": 56 , "y": 52}, + {"flags": 4, "matrix": [4, 5], "x": 70 , "y": 52}, + {"flags": 4, "matrix": [4, 6], "x": 84 , "y": 52}, + {"flags": 4, "matrix": [4, 7], "x": 98 , "y": 52}, + {"flags": 4, "matrix": [4, 8], "x": 112, "y": 52}, + {"flags": 4, "matrix": [4, 9], "x": 126, "y": 52}, + {"flags": 4, "matrix": [4,10], "x": 140, "y": 52}, + {"flags": 4, "matrix": [4,11], "x": 154, "y": 52}, + {"flags": 4, "matrix": [4,13], "x": 182, "y": 52}, + {"flags": 4, "matrix": [4,15], "x": 210, "y": 52}, + {"flags": 4, "matrix": [5, 0], "x": 0 , "y": 64}, + {"flags": 4, "matrix": [5, 1], "x": 14 , "y": 64}, + {"flags": 4, "matrix": [5, 2], "x": 28 , "y": 64}, + {"flags": 4, "matrix": [5, 6], "x": 84 , "y": 64}, + {"flags": 4, "matrix": [5,10], "x": 140, "y": 64}, + {"flags": 4, "matrix": [5,11], "x": 154, "y": 64}, + {"flags": 4, "matrix": [5,12], "x": 168, "y": 64}, + {"flags": 4, "matrix": [5,13], "x": 182, "y": 64}, + {"flags": 4, "matrix": [5,14], "x": 196, "y": 64}, + {"flags": 4, "matrix": [5,15], "x": 210, "y": 64}, + {"flags": 4, "matrix": [5,16], "x": 224, "y": 64} + ], + "sleep": true + }, + "community_layouts": ["tkl_f13_ansi"], + "layouts": { + "LAYOUT_tkl_f13_ansi": { + "layout": [ + {"matrix": [0,0], "x": 0, "y": 0 }, + {"matrix": [0,1], "x": 1.5, "y": 0 }, + {"matrix": [0,2], "x": 2.5, "y": 0 }, + {"matrix": [0,3], "x": 3.5, "y": 0 }, + {"matrix": [0,4], "x": 4.5, "y": 0 }, + {"matrix": [0,5], "x": 5.75, "y": 0 }, + {"matrix": [0,6], "x": 6.75, "y": 0 }, + {"matrix": [0,7], "x": 7.75, "y": 0 }, + {"matrix": [0,8], "x": 8.75, "y": 0 }, + {"matrix": [0,9], "x": 10, "y": 0 }, + {"matrix": [0,10], "x": 11, "y": 0 }, + {"matrix": [0,11], "x": 12, "y": 0 }, + {"matrix": [0,12], "x": 13, "y": 0 }, + {"matrix": [0,13], "x": 14.25, "y": 0 }, + {"matrix": [0,14], "x": 15.75, "y": 0 }, + {"matrix": [0,15], "x": 16.75, "y": 0 }, + {"matrix": [0,16], "x": 17.75, "y": 0 }, + {"matrix": [1,0], "x": 0, "y": 1.25 }, + {"matrix": [1,1], "x": 1, "y": 1.25 }, + {"matrix": [1,2], "x": 2, "y": 1.25 }, + {"matrix": [1,3], "x": 3, "y": 1.25 }, + {"matrix": [1,4], "x": 4, "y": 1.25 }, + {"matrix": [1,5], "x": 5, "y": 1.25 }, + {"matrix": [1,6], "x": 6, "y": 1.25 }, + {"matrix": [1,7], "x": 7, "y": 1.25 }, + {"matrix": [1,8], "x": 8, "y": 1.25 }, + {"matrix": [1,9], "x": 9, "y": 1.25 }, + {"matrix": [1,10], "x": 10, "y": 1.25 }, + {"matrix": [1,11], "x": 11, "y": 1.25 }, + {"matrix": [1,12], "x": 12, "y": 1.25 }, + {"matrix": [1,13], "x": 13, "y": 1.25, "w": 2.25 }, + {"matrix": [1,14], "x": 15.75, "y": 1.25 }, + {"matrix": [1,15], "x": 16.75, "y": 1.25 }, + {"matrix": [1,16], "x": 17.75, "y": 1.25 }, + {"matrix": [2,0], "x": 0, "y": 2.25, "w": 1.5 }, + {"matrix": [2,1], "x": 1.5, "y": 2.25 }, + {"matrix": [2,2], "x": 2.5, "y": 2.25 }, + {"matrix": [2,3], "x": 3.5, "y": 2.25 }, + {"matrix": [2,4], "x": 4.5, "y": 2.25 }, + {"matrix": [2,5], "x": 5.5, "y": 2.25 }, + {"matrix": [2,6], "x": 6.5, "y": 2.25 }, + {"matrix": [2,7], "x": 7.5, "y": 2.25 }, + {"matrix": [2,8], "x": 8.5, "y": 2.25 }, + {"matrix": [2,9], "x": 9.5, "y": 2.25 }, + {"matrix": [2,10], "x": 10.5, "y": 2.25 }, + {"matrix": [2,11], "x": 11.5, "y": 2.25 }, + {"matrix": [2,12], "x": 12.5, "y": 2.25 }, + {"matrix": [2,13], "x": 13.5, "y": 2.25, "w": 1.75 }, + {"matrix": [2,14], "x": 15.75, "y": 2.25 }, + {"matrix": [2,15], "x": 16.75, "y": 2.25 }, + {"matrix": [2,16], "x": 17.75, "y": 2.25 }, + {"matrix": [3,0], "x": 0, "y": 3.25, "w": 1.75 }, + {"matrix": [3,1], "x": 1.75, "y": 3.25 }, + {"matrix": [3,2], "x": 2.75, "y": 3.25 }, + {"matrix": [3,3], "x": 3.75, "y": 3.25 }, + {"matrix": [3,4], "x": 4.75, "y": 3.25 }, + {"matrix": [3,5], "x": 5.75, "y": 3.25 }, + {"matrix": [3,6], "x": 6.75, "y": 3.25 }, + {"matrix": [3,7], "x": 7.75, "y": 3.25 }, + {"matrix": [3,8], "x": 8.75, "y": 3.25 }, + {"matrix": [3,9], "x": 9.75, "y": 3.25 }, + {"matrix": [3,10], "x": 10.75, "y": 3.25 }, + {"matrix": [3,11], "x": 11.75, "y": 3.25 }, + {"matrix": [3,13], "x": 12.75, "y": 3.25, "w": 2.5 }, + {"matrix": [4,0], "x": 0, "y": 4.25, "w": 2.25 }, + {"matrix": [4,2], "x": 2.25, "y": 4.25 }, + {"matrix": [4,3], "x": 3.25, "y": 4.25 }, + {"matrix": [4,4], "x": 4.25, "y": 4.25 }, + {"matrix": [4,5], "x": 5.25, "y": 4.25 }, + {"matrix": [4,6], "x": 6.25, "y": 4.25 }, + {"matrix": [4,7], "x": 7.25, "y": 4.25 }, + {"matrix": [4,8], "x": 8.25, "y": 4.25 }, + {"matrix": [4,9], "x": 9.25, "y": 4.25 }, + {"matrix": [4,10], "x": 10.25, "y": 4.25 }, + {"matrix": [4,11], "x": 11.25, "y": 4.25 }, + {"matrix": [4,13], "x": 12.25, "y": 4.25, "w": 3 }, + {"matrix": [4,15], "x": 16.75, "y": 4.25 }, + {"matrix": [5,0], "x": 0, "y": 5.25, "w": 1.25 }, + {"matrix": [5,1], "x": 1.25, "y": 5.25, "w": 1.25 }, + {"matrix": [5,2], "x": 2.5, "y": 5.25, "w": 1.25 }, + {"matrix": [5,6], "x": 3.75, "y": 5.25, "w": 6.5 }, + {"matrix": [5,10], "x": 10.25, "y": 5.25, "w": 1.25 }, + {"matrix": [5,11], "x": 11.5, "y": 5.25, "w": 1.25 }, + {"matrix": [5,12], "x": 12.75, "y": 5.25, "w": 1.25 }, + {"matrix": [5,13], "x": 14, "y": 5.25, "w": 1.25 }, + {"matrix": [5,14], "x": 15.75, "y": 5.25 }, + {"matrix": [5,15], "x": 16.75, "y": 5.25 }, + {"matrix": [5,16], "x": 17.75, "y": 5.25 } + ] + } + } +} diff --git a/keyboards/moky/moky88/keymaps/default/keymap.c b/keyboards/moky/moky88/keymaps/default/keymap.c new file mode 100644 index 0000000000..5b86c306cf --- /dev/null +++ b/keyboards/moky/moky88/keymaps/default/keymap.c @@ -0,0 +1,73 @@ +// Copyright 2023 VertorWang (@itarze) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_tkl_f13_ansi( /* Base */ + KC_ESC, 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_MUTE, KC_PSCR, KC_SCRL, KC_PAUSE, + KC_GRV, 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_BSPC, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_ENT, + KC_LSFT, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_tkl_f13_ansi( /* Base */ + _______, KC_MSEL, KC_VOLD, KC_VOLU, KC_MUTE, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MAIL, KC_WHOM, KC_CALC, KC_WSCH, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, RGB_TOG, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, RGB_MOD, _______, _______, _______, + _______, TO(0), TO(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI), + + [2] = LAYOUT_tkl_f13_ansi( /* Base */ + KC_ESC, KC_BRMD, KC_BRMU, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_PSCR, KC_SCRL, KC_PAUSE, + KC_GRV, 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_BSPC, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_ENT, + KC_LSFT, 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(3), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [3] = LAYOUT_tkl_f13_ansi( /* FN */ + _______, 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_MUTE, KC_PSCR, KC_SCRL, KC_PAUSE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, RGB_TOG, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, RGB_MOD, _______, _______, _______, + _______, TO(0), TO(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI), +}; + +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + + [0] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD)}, + [1] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD)}, + [2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS)}, + [3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS)}, +}; + +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + + if (get_highest_layer(default_layer_state | layer_state) == 1) { + rgb_matrix_set_color(52, RGB_WHITE); + } else if (get_highest_layer(default_layer_state | layer_state) == 3) { + rgb_matrix_set_color(53, RGB_WHITE); + } + + if (host_keyboard_led_state().caps_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(51, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS); + } + if (host_keyboard_led_state().scroll_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(15, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS); + } + if (keymap_config.no_gui) { + if (get_highest_layer(default_layer_state) == 0) { + RGB_MATRIX_INDICATOR_SET_COLOR(80, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS); + } else if (get_highest_layer(default_layer_state) == 2) { + RGB_MATRIX_INDICATOR_SET_COLOR(81, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS); + } + } + + return true; +} diff --git a/keyboards/moky/moky88/keymaps/default/rules.mk b/keyboards/moky/moky88/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/moky/moky88/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/moky/moky88/keymaps/via/keymap.c b/keyboards/moky/moky88/keymaps/via/keymap.c new file mode 100644 index 0000000000..c67ded7b65 --- /dev/null +++ b/keyboards/moky/moky88/keymaps/via/keymap.c @@ -0,0 +1,73 @@ +// Copyright 2023 VertorWang (@itarze) +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_tkl_f13_ansi( /* Base */ + KC_ESC, 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_MUTE, KC_PSCR, KC_SCRL, KC_PAUSE, + KC_GRV, 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_BSPC, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_ENT, + KC_LSFT, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_tkl_f13_ansi( /* Base */ + QK_BOOT, KC_MSEL, KC_VOLD, KC_VOLU, KC_MUTE, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MAIL, KC_WHOM, KC_CALC, KC_WSCH, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, RGB_TOG, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, RGB_MOD, _______, _______, _______, + _______, TO(0), TO(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, GU_TOGG, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI), + + [2] = LAYOUT_tkl_f13_ansi( /* Base */ + KC_ESC, KC_BRMD, KC_BRMU, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_PSCR, KC_SCRL, KC_PAUSE, + KC_GRV, 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_BSPC, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, + 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_ENT, + KC_LSFT, 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(3), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [3] = LAYOUT_tkl_f13_ansi( /* FN */ + QK_BOOT, 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_MUTE, KC_PSCR, KC_SCRL, KC_PAUSE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, RGB_TOG, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, RGB_MOD, _______, _______, _______, + _______, TO(0), TO(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI), +}; + +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + + [0] = { ENCODER_CCW_CW(KC_VOLU, KC_VOLD)}, + [1] = { ENCODER_CCW_CW(RGB_RMOD, RGB_MOD)}, + [2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS)}, + [3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS)}, +}; + +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + + if (get_highest_layer(default_layer_state | layer_state) == 1) { + rgb_matrix_set_color(52, RGB_WHITE); + } else if (get_highest_layer(default_layer_state | layer_state) == 3) { + rgb_matrix_set_color(53, RGB_WHITE); + } + + if (host_keyboard_led_state().caps_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(51, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS); + } + if (host_keyboard_led_state().scroll_lock) { + RGB_MATRIX_INDICATOR_SET_COLOR(15, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS); + } + if (keymap_config.no_gui) { + if (get_highest_layer(default_layer_state) == 0) { + RGB_MATRIX_INDICATOR_SET_COLOR(80, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS); + } else if (get_highest_layer(default_layer_state) == 2) { + RGB_MATRIX_INDICATOR_SET_COLOR(81, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS, RGB_MATRIX_MAXIMUM_BRIGHTNESS); + } + } + + return true; +} diff --git a/keyboards/moky/moky88/keymaps/via/rules.mk b/keyboards/moky/moky88/keymaps/via/rules.mk new file mode 100644 index 0000000000..715838ecc5 --- /dev/null +++ b/keyboards/moky/moky88/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +ENCODER_MAP_ENABLE = yes +VIA_ENABLE = yes diff --git a/keyboards/moky/moky88/mcuconf.h b/keyboards/moky/moky88/mcuconf.h new file mode 100644 index 0000000000..848f55377e --- /dev/null +++ b/keyboards/moky/moky88/mcuconf.h @@ -0,0 +1,22 @@ +/* Copyright (C) 2023 Westberry Technology Corp., Ltd + * + * 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 . + */ + +#pragma once + +#include_next + +#undef WB32_SPI_USE_QSPI +#define WB32_SPI_USE_QSPI TRUE diff --git a/keyboards/moky/moky88/moky88.c b/keyboards/moky/moky88/moky88.c new file mode 100644 index 0000000000..3cbd6e1468 --- /dev/null +++ b/keyboards/moky/moky88/moky88.c @@ -0,0 +1,119 @@ +/* Copyright (C) 2023 Westberry Technology Corp., Ltd + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, CS18_SW2, CS17_SW2, CS16_SW2 }, // 0 Esc + {0, CS18_SW3, CS17_SW3, CS16_SW3 }, // 1 F1 + {0, CS18_SW4, CS17_SW4, CS16_SW4 }, // 2 F2 + {0, CS18_SW5, CS17_SW5, CS16_SW5 }, // 3 F3 + {0, CS18_SW6, CS17_SW6, CS16_SW6 }, // 4 F4 + {0, CS18_SW7, CS17_SW7, CS16_SW7 }, // 5 F5 + {0, CS18_SW8, CS17_SW8, CS16_SW8 }, // 6 F6 + {0, CS18_SW9, CS17_SW9, CS16_SW9 }, // 7 F7 + {0, CS18_SW10, CS17_SW10, CS16_SW10 }, // 8 F8 + {0, CS18_SW11, CS17_SW11, CS16_SW11 }, // 9 F9 + {0, CS18_SW12, CS17_SW12, CS16_SW12 }, // 10 F10 + {1, CS18_SW1, CS17_SW1, CS16_SW1 }, // 11 F11 + {1, CS18_SW2, CS17_SW2, CS16_SW2 }, // 12 F12 + {1, CS18_SW3, CS17_SW3, CS16_SW3 }, // 13 MUTE + {1, CS18_SW4, CS17_SW4, CS16_SW4 }, // 14 PSCR + {1, CS18_SW5, CS17_SW5, CS16_SW5 }, // 15 SCRL + {1, CS18_SW6, CS17_SW6, CS16_SW6 }, // 16 PAUSE + + {0, CS15_SW2, CS14_SW2, CS13_SW2 }, // 17 `~ + {0, CS15_SW3, CS14_SW3, CS13_SW3 }, // 18 1 + {0, CS15_SW4, CS14_SW4, CS13_SW4 }, // 19 2 + {0, CS15_SW5, CS14_SW5, CS13_SW5 }, // 20 3 + {0, CS15_SW6, CS14_SW6, CS13_SW6 }, // 21 4 + {0, CS15_SW7, CS14_SW7, CS13_SW7 }, // 22 5 + {0, CS15_SW8, CS14_SW8, CS13_SW8 }, // 23 6 + {0, CS15_SW9, CS14_SW9, CS13_SW9 }, // 24 7 + {0, CS15_SW10, CS14_SW10, CS13_SW10 }, // 25 8 + {0, CS15_SW11, CS14_SW11, CS13_SW11 }, // 26 9 + {0, CS15_SW12, CS14_SW12, CS13_SW12 }, // 27 0 + {1, CS15_SW1, CS14_SW1, CS13_SW1 }, // 28 -_ + {1, CS15_SW2, CS14_SW2, CS13_SW2 }, // 29 =+ + {1, CS15_SW3, CS14_SW3, CS13_SW3 }, // 30 BSPC + {1, CS15_SW4, CS14_SW4, CS13_SW4 }, // 31 INS + {1, CS15_SW5, CS14_SW5, CS13_SW5 }, // 32 HOME + {1, CS15_SW6, CS14_SW6, CS13_SW6 }, // 33 PGUP + + {0, CS12_SW2, CS11_SW2, CS10_SW2 }, // 34 Tab + {0, CS12_SW3, CS11_SW3, CS10_SW3 }, // 35 Q + {0, CS12_SW4, CS11_SW4, CS10_SW4 }, // 36 W + {0, CS12_SW5, CS11_SW5, CS10_SW5 }, // 37 E + {0, CS12_SW6, CS11_SW6, CS10_SW6 }, // 38 R + {0, CS12_SW7, CS11_SW7, CS10_SW7 }, // 39 T + {0, CS12_SW8, CS11_SW8, CS10_SW8 }, // 40 Y + {0, CS12_SW9, CS11_SW9, CS10_SW9 }, // 41 U + {0, CS12_SW10, CS11_SW10, CS10_SW10 }, // 42 I + {0, CS12_SW11, CS11_SW11, CS10_SW11 }, // 43 O + {0, CS12_SW12, CS11_SW12, CS10_SW12 }, // 44 P + {1, CS12_SW1, CS11_SW1, CS10_SW1 }, // 45 [{ + {1, CS12_SW2, CS11_SW2, CS10_SW2 }, // 48 ]} + {1, CS12_SW3, CS11_SW3, CS10_SW3 }, // 47 \| + {1, CS12_SW4, CS11_SW4, CS10_SW4 }, // 48 Del + {1, CS12_SW5, CS11_SW5, CS10_SW5 }, // 49 End + {1, CS12_SW6, CS11_SW6, CS10_SW6 }, // 50 PGDN + + {0, CS1_SW2, CS2_SW2, CS3_SW2 }, // 51 Caps + {0, CS1_SW3, CS2_SW3, CS3_SW3 }, // 52 A + {0, CS1_SW4, CS2_SW4, CS3_SW4 }, // 33 S + {0, CS1_SW5, CS2_SW5, CS3_SW5 }, // 54 D + {0, CS1_SW6, CS2_SW6, CS3_SW6 }, // 55 F + {0, CS1_SW7, CS2_SW7, CS3_SW7 }, // 56 G + {0, CS1_SW8, CS2_SW8, CS3_SW8 }, // 57 H + {0, CS1_SW9, CS2_SW9, CS3_SW9 }, // 58 J + {0, CS1_SW10, CS2_SW10, CS3_SW10 }, // 59 K + {0, CS1_SW11, CS2_SW11, CS3_SW11 }, // 60 L + {0, CS1_SW12, CS2_SW12, CS3_SW12 }, // 61 ;: + {1, CS1_SW1, CS2_SW1, CS3_SW1 }, // 62 ' + {1, CS1_SW3, CS2_SW3, CS3_SW3 }, // 63 Enter + + {0, CS4_SW2, CS5_SW2, CS6_SW2 }, // 64 Shift + {0, CS4_SW4, CS5_SW4, CS6_SW4 }, // 65 Z + {0, CS4_SW5, CS5_SW5, CS6_SW5 }, // 66 X + {0, CS4_SW6, CS5_SW6, CS6_SW6 }, // 67 C + {0, CS4_SW7, CS5_SW7, CS6_SW7 }, // 68 V + {0, CS4_SW8, CS5_SW8, CS6_SW8 }, // 69 B + {0, CS4_SW9, CS5_SW9, CS6_SW9 }, // 70 N + {0, CS4_SW10, CS5_SW10, CS6_SW10 }, // 71 M + {0, CS4_SW11, CS5_SW11, CS6_SW11 }, // 72 ,< + {0, CS4_SW12, CS5_SW12, CS6_SW12 }, // 73 .> + {1, CS4_SW1, CS5_SW1, CS6_SW1 }, // 74 ? + {1, CS4_SW3, CS5_SW3, CS6_SW3 }, // 75 Shift + {1, CS4_SW5, CS5_SW5, CS6_SW5 }, // 76 Up + + {0, CS7_SW2, CS8_SW2, CS9_SW2 }, // 77 Ctrl_L + {0, CS7_SW3, CS8_SW3, CS9_SW3 }, // 78 Win_L + {0, CS7_SW4, CS8_SW4, CS9_SW4 }, // 79 ALT_L + {0, CS7_SW8, CS8_SW8, CS9_SW8 }, // 80 SPACE + {0, CS7_SW12, CS8_SW12, CS9_SW12 }, // 81 ALT_L + {1, CS7_SW1, CS8_SW1, CS9_SW1 }, // 82 Win_L + {1, CS7_SW2, CS8_SW2, CS9_SW2 }, // 83 Fn + {1, CS7_SW3, CS8_SW3, CS9_SW3 }, // 84 Ctrl_L + {1, CS7_SW4, CS8_SW4, CS9_SW4 }, // 85 Left + {1, CS7_SW5, CS8_SW5, CS9_SW5 }, // 86 Down + {1, CS7_SW6, CS8_SW6, CS9_SW6 }, // 87 Right +}; diff --git a/keyboards/moky/moky88/readme.md b/keyboards/moky/moky88/readme.md new file mode 100644 index 0000000000..62dc876eb2 --- /dev/null +++ b/keyboards/moky/moky88/readme.md @@ -0,0 +1,26 @@ +# moky88 +![moky/moky88](https://i.imgur.com/lssV4bq.png) + +An in-switch RGB LED keyboard with RGB underglow. + +* Keyboard Maintainer: [Vertor](https://github.com/VertorWang) +* Hardware Supported: moky88 +* Hardware Availability: Private GB + +Make example for this keyboard (after setting up your build environment): + + make moky/moky88:default + +Flashing example for this keyboard: + + make moky/moky88:default:flash + +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). + +## Bootloader + +Enter the bootloader in 3 ways: + +* **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 - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available diff --git a/keyboards/moky/moky88/rules.mk b/keyboards/moky/moky88/rules.mk new file mode 100644 index 0000000000..7ff128fa69 --- /dev/null +++ b/keyboards/moky/moky88/rules.mk @@ -0,0 +1 @@ +# This file intentionally left blank \ No newline at end of file