Skip to content

Commit

Permalink
add ws69v2 keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jul 18, 2021
1 parent 0c625e7 commit e869849
Show file tree
Hide file tree
Showing 14 changed files with 364 additions and 4 deletions.
46 changes: 46 additions & 0 deletions keyboards/yandrstudio/WS69v2/WS69v2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include QMK_KEYBOARD_H
#define XX NO_LED

#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = {
{
{71 ,70 ,69 ,68 ,67 ,66 ,65 ,64 ,63 ,62 ,61 ,60 ,59 ,58 ,57},
{56 ,55 ,54 ,53 ,52 ,51 ,50 ,49 ,48 ,47 ,46 ,45 ,44 ,43 ,42}, \
{41 ,40 ,39 ,38 ,37 ,36 ,35 ,34 ,33 ,32 ,31 ,30 ,29 ,28}, \
{27 ,26 ,25 ,24 ,23 ,22 ,21 ,20 ,19 ,18 ,17 ,16 ,15 ,14 ,13}, \
{12 ,11 ,10 ,9 ,XX ,8 ,7 ,XX ,6 ,5 ,4 ,3 ,2 ,1 ,0}, \
},
{
// LED Index to Physical Position
{32,128}, {32,120}, {32,112}, {32,104}, {32,96}, {32,88}, {32,80}, {32,72}, {32,64}, {32,56}, {32,48}, {32,40}, {32,32}, {32,20}, {32,5},
{24,133}, {24,122}, {24,114}, {24,106}, {24,98}, {24,90}, {24,82}, {24,74}, {24,66}, {24,58}, {24,50}, {24,37}, {24,24}, {24,16}, {24,5},
{16,133}, {16,120}, {16,112}, {16,104}, {16,96}, {16,88}, {16,80}, {16,72}, {16,64}, {16,56}, {16,40}, {16,24}, {16,16}, {16,5},
{8,123}, {8,112}, {8,104}, {8,96}, {8,88}, {8,80}, {8,72}, {8,64}, {8,56}, {8,48}, {8,40}, {8,32}, {8,24}, {8,16}, {8,5},
{0,132}, {0,128}, {0,120}, {0,104}, {0,88},{0,80}, {0,56}, {0,48}, {0,40}, {0,32}, {0,24}, {0,16}, {0,5},

},
{
// LED Index to Flag
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4
}
};
#endif

#ifdef RGB_DISABLE_WHEN_USB_SUSPENDED
void suspend_power_down_kb(void) {
rgb_matrix_set_suspend_state(true);
suspend_power_down_user();
}

void suspend_wakeup_init_kb(void) {
rgb_matrix_set_suspend_state(false);
suspend_wakeup_init_user();
}
#endif
19 changes: 19 additions & 0 deletions keyboards/yandrstudio/WS69v2/WS69v2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//#ifndef KB_H
//#define KB_H
#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, K114, \
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K211, K212, K213, K214, \
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \
K400, K401, K402, K403, K405, K406, K408, K409, K410, K411, K412, K413, K414 \
) { \
{ 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, K114 }, \
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, KC_NO, K211, K212, K213, K214 }, \
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \
{ K400, K401, K402, K403, KC_NO, K405, K406, KC_NO, K408, K409, K410, K411, K412, K413, K414 } \
}
7 changes: 7 additions & 0 deletions keyboards/yandrstudio/WS69v2/chconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#define CH_CFG_ST_TIMEDELTA 0

#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE

#include_next <chconf.h>
43 changes: 43 additions & 0 deletions keyboards/yandrstudio/WS69v2/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//#ifndef CONFIG_H
//#define CONFIG_H
#pragma once
#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0xAA96
#define PRODUCT_ID 0xAAA5
#define DEVICE_VER 0x0001
#define MANUFACTURER lkaillAndBiu
#define PRODUCT WS69v2

/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 15
#define MATRIX_ROW_PINS { C13, B7, B6, C14, B8}
#define MATRIX_COL_PINS { A15, B3, B4, B5, B9, B14, B13, A3, A4, A5, A6, A7, B0, B1, A8}
#define DIODE_DIRECTION COL2ROW //ROW2COL
#define DEBOUNCE 1
#define FORCE_NKRO

/* RGN Matrix */
#ifdef RGB_MATRIX_ENABLE
#define RGB_DI_PIN B15
#define RGBLED_NUM 72
#define DRIVER_LED_TOTAL RGBLED_NUM

#define WS2812_SPI SPID2 // default: SPID1
#define WS2812_SPI_MOSI_PAL_MODE 5


#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
#define RGBLIGHT_VAL_STEP 10
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 10
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
#define RGB_MATRIX_CENTER { 32, 96 }
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS

#endif


9 changes: 9 additions & 0 deletions keyboards/yandrstudio/WS69v2/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once
#include_next <halconf.h>

#undef HAL_USE_SPI
#define HAL_USE_SPI TRUE

#undef SPI_SELECT_MODE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD

135 changes: 135 additions & 0 deletions keyboards/yandrstudio/WS69v2/info-via.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"name": "WM69_Y&R",
"vendorId": "0xAA96",
"productId": "0xAAA5",
"lighting": {
"extends": "none",
"keycodes": "qmk"
},
"matrix": {
"rows": 5,
"cols": 15
},
"layouts": {
"keymap": [
[
"0,0",
"0,1",
"0,2",
"0,3",
"0,4",
"0,5",
"0,6",
"0,7",
"0,8",
"0,9",
"0,10",
"0,11",
"0,12",
{
"w": 2
},
"0,13",
"0,14"
],
[
{
"w": 1.5
},
"1,0",
"1,1",
"1,2",
"1,3",
"1,4",
"1,5",
"1,6",
"1,7",
"1,8",
"1,9",
"1,10",
{
"w": 1.5
},
"1,11",
"1,12",
"1,13",
"1,14"
],
[
{
"w": 1.75
},
"2,0",
"2,1",
"2,2",
"2,3",
"2,4",
"2,5",
"2,6",
"2,7",
"2,8",
"2,9",
{
"w": 2.25
},
"2,11",
"2,12",
"2,13",
"2,14"
],
[
{
"w": 2
},
"3,0",
"3,1",
"3,2",
"3,3",
"3,4",
"3,5",
"3,6",
"3,7",
"3,8",
"3,9",
"3,10",
"3,11",
"3,12",
"3,13",
"3,14"
],
[
{
"w": 1.25
},
"4,0",
{
"w": 1.25
},
"4,1",
{
"w": 1.25
},
"4,2",
"4,3",
{
"x": 0.5
},
"4,5",
{
"x": 0.5
},
"4,6",
{
"x": 1.25
},
"4,8",
"4,9",
"4,10",
"4,11",
"4,12",
"4,13",
"4,14"
]
]
}
}
30 changes: 30 additions & 0 deletions keyboards/yandrstudio/WS69v2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

#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_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_P7, KC_P8, KC_P9,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_P4, KC_P5, KC_P6,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RGB_MOD, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT),
LAYOUT(
KC_TRNS, 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_TRNS,
RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_PGUP,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, 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_END, KC_TRNS, KC_PGDN,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_DEL),
LAYOUT(
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, 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, 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, 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),
LAYOUT(
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, 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, 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, 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),
};

30 changes: 30 additions & 0 deletions keyboards/yandrstudio/WS69v2/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

#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_BSPC, KC_DEL,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, KC_P7, KC_P8, KC_P9,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_P4, KC_P5, KC_P6,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RGB_MOD, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT),
LAYOUT(
KC_TRNS, 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_TRNS,
RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, KC_PGUP,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, 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_END, KC_TRNS, KC_PGDN,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_DEL),
LAYOUT(
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, 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, 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, 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),
LAYOUT(
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, 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, 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, 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),
};
;
2 changes: 2 additions & 0 deletions keyboards/yandrstudio/WS69v2/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
6 changes: 6 additions & 0 deletions keyboards/yandrstudio/WS69v2/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

#include_next <mcuconf.h>

#undef STM32_SPI_USE_SPI2
#define STM32_SPI_USE_SPI2 TRUE
15 changes: 15 additions & 0 deletions keyboards/yandrstudio/WS69v2/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
whiteMouse69 version 2.0
===

A 69 keys keyboard with rgb (keys).
This keyboard use 8mhz HSE and STM32F103 as MCU.

Keyboard Maintainer: https://github.com/jiaxin96
Hardware Supported: WS69v2
Hardware Availability: https://github.com/Oh-My-Mechanical-Keyboard

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

make yandrstudio/WS69v2:default

See [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.
16 changes: 16 additions & 0 deletions keyboards/yandrstudio/WS69v2/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# MCU name
MCU = STM32F103

# Bootloader selection
BOOTLOADER = stm32duino

# change yes to no to disable
EXTRAKEY_ENABLE = yes # Audio control and System control
NKRO_ENABLE = yes # USB Nkey Rollover

RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
WS2812_DRIVER = spi

# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
4 changes: 3 additions & 1 deletion keyboards/yandrstudio/final80v2/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void matrix_scan_user(void) {
}

// {编码器功能} -----------------------------------------------//
void encoder_update_user(uint8_t index, bool clockwise) {
bool encoder_update_user(uint8_t index, bool clockwise) {
switch (biton32(layer_state)) { // 层检查
// 1 = _UPPER:
case 1:
Expand Down Expand Up @@ -104,6 +104,8 @@ void encoder_update_user(uint8_t index, bool clockwise) {
}
break;
}

return false;
}

// [OLED 设置] ---------------------------------------------//
Expand Down
Loading

0 comments on commit e869849

Please sign in to comment.