Skip to content

Commit

Permalink
fix whitemouse69 rgb position
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Aug 1, 2021
1 parent 260a647 commit fba647d
Show file tree
Hide file tree
Showing 23 changed files with 1,558 additions and 23 deletions.
15 changes: 7 additions & 8 deletions keyboards/yandrstudio/WS69v2/WS69v2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ 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}, \
{41 ,40 ,39 ,38 ,37 ,36 ,35 ,34 ,33 ,32 ,31 ,30 ,29 ,28, NO_LED}, \
{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}, \
{12 ,11 ,10 ,9 ,NO_LED,8 ,7 ,NO_LED,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},

{224,64}, {208,64}, {192,64}, {176,64}, {160,64}, {144,64}, {128,64}, {96,64},{80,64}, {48,64},{32,64},{16,64},{0,64},\
{224,48},{208,48},{192,48},{176,48},{160,48},{144,48},{128,48},{112,48},{96,48},{80,48},{64,48},{48,48},{32,48},{16,48},{0,48},\
{208,32},{192,32},{176,32},{160,32},{144,32},{128,32},{112,32},{96,32},{80,32},{64,32},{48,32},{32,32},{16,32},{0,32},\
{224,16},{208,16},{192,16},{176,16},{160,16},{144,16},{128,16},{112,16},{96,16},{80,16},{64,16},{48,16},{32,16},{16,16},{0,16},\
{224,0},{208,0},{192,0},{176,0},{160,0},{144,0},{128,0},{112,0},{96,0},{80,0},{64,0},{48,0},{32,0},{16,0},{0,0}
},
{
// LED Index to Flag
Expand Down
1 change: 1 addition & 0 deletions keyboards/yandrstudio/whiteMouse69/f401/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#define MATRIX_COL_PINS { A15, B3, B4, B5, B9, B14, B13, A3, A4, A5, A6, A7, B0, B1, A8}
#define MATRIX_ROW_PINS { C13, B7, B6, C14, B8}


/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

Expand Down
27 changes: 13 additions & 14 deletions keyboards/yandrstudio/whiteMouse69/whiteMouse69.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,28 @@ 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}, \
{41 ,40 ,39 ,38 ,37 ,36 ,35 ,34 ,33 ,32 ,31 ,30 ,29 ,28, NO_LED}, \
{27 ,26 ,25 ,24 ,23 ,22 ,21 ,20 ,19 ,18 ,17 ,16 ,15 ,14 ,13}, \
{12 ,11 ,10 ,9 ,NO_LED,8 ,7 ,NO_LED,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},

{224,64}, {208,64}, {192,64}, {176,64}, {160,64}, {144,64}, {128,64}, {96,64},{80,64}, {48,64},{32,64},{16,64},{0,64},\
{224,48},{208,48},{192,48},{176,48},{160,48},{144,48},{128,48},{112,48},{96,48},{80,48},{64,48},{48,48},{32,48},{16,48},{0,48},\
{208,32},{192,32},{176,32},{160,32},{144,32},{128,32},{112,32},{96,32},{80,32},{64,32},{48,32},{32,32},{16,32},{0,32},\
{224,16},{208,16},{192,16},{176,16},{160,16},{144,16},{128,16},{112,16},{96,16},{80,16},{64,16},{48,16},{32,16},{16,16},{0,16},\
{224,0},{208,0},{192,0},{176,0},{160,0},{144,0},{128,0},{112,0},{96,0},{80,0},{64,0},{48,0},{32,0},{16,0},{0,0}
},
{
// 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
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
}
};

Expand Down
63 changes: 63 additions & 0 deletions keyboards/yandrstudio/yp87ble/M69.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* Copyright 2021 JasonRen(biu)
*
* 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



#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = {
{
{0, NO_LED, 1, 2, 3, 4, NO_LED, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, \
{34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 19, 18, 17, 16}, \
{35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, NO_LED, 48, 49, 50, 51}, \
{66, 65, 64, 63, 62, 61, 60, 59, 58, 57, 56, 55, 54, NO_LED, 53, NO_LED, NO_LED, NO_LED}, \
{68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, NO_LED, 82, NO_LED, 83, NO_LED}, \
{95, 94, 93, NO_LED, NO_LED, NO_LED, 91, NO_LED, NO_LED, NO_LED, 90, 89, 88, NO_LED, 87, 86, 85, 84}
},
{
// LED Index to Physical Position
{0,0}, {26,0},{40,0},{53,0},{66,0}, {92,0},{105,0},{119,0},{132,0},{145,0},{158,0},{171,0},{184,0},{198,0},{211,0},{224,0}, \
{224,13},{211,13},{198,13},{184,13},{184,13},{171,13},{158,13},{145,13},{132,13},{119,13},{105,13},{92,13},{79,13},{66,13},{53,13},{40,13},{26,13},{13,13},{0,13}, \
{0,26},{13,26},{26,26},{40,26},{53,26},{66,26},{79,26},{92,26},{105,26},{119,26},{132,26},{145,26},{158,26}, {184,26},{198,26},{211,26},{224,26}, \
{184,38},{184,38}, {158,38},{145,38},{132,38},{119,38},{105,38},{92,38},{79,38},{66,38},{53,38},{40,38},{26,38},{13,38},{0,38}, \
{0,51},{0,51},{13,51},{26,51},{40,51},{53,51},{66,51},{79,51},{92,51},{105,51},{119,51},{132,51},{145,51},{158,51},{171,51},{184,51}, {211,51}, \
{224,64},{211,64},{198,64},{184,64}, {158,64},{145,64},{132,64}, {92,64},{66,64}, {26,64},{13,64},{0,64}
},
{
// 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, \
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
34 changes: 34 additions & 0 deletions keyboards/yandrstudio/yp87ble/M69.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright 2020 zvecr <[email protected]>
*
* 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 LAYOUT( \
K000, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, \
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217, \
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, K316, K317, \
K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K414, \
K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K514, K516, \
K600, K601, K602, K606, K610, K611, K613, K614, K615, K616, K617 \
) { \
{ K000, KC_NO, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017 }, \
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, K217 }, \
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315, K316, K317 }, \
{ K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO, K414, KC_NO, KC_NO, KC_NO }, \
{ K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, KC_NO, K514, KC_NO, K516, KC_NO }, \
{ K600, K601, K602, KC_NO, KC_NO, KC_NO, K606, KC_NO, KC_NO, KC_NO, K610, K611, KC_NO, K613, K614, K615, K616, K617 } \
}
43 changes: 43 additions & 0 deletions keyboards/yandrstudio/yp87ble/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/* Copyright 2021 JasonRen(biu)
*
* 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 0xAA96
#define PRODUCT_ID 0xAAA6
#define DEVICE_VER 0x0001
#define MANUFACTURER JasonRen biu
#define PRODUCT M69

// enable the nkro when using the VIA.
#define FORCE_NKRO

// fix VIA RGB_light
#define VIA_HAS_BROKEN_KEYCODES

/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST

/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5

// #define DEBUG_MATRIX_SCAN_RATE

#define USB_POLLING_INTERVAL_MS 1
#define QMK_KEYS_PER_SCAN 4

25 changes: 25 additions & 0 deletions keyboards/yandrstudio/yp87ble/f401/board.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* Copyright 2020 Nick Brassel (tzarc)
*
* 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 3 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 <https://www.gnu.org/licenses/>.
*/
#pragma once

#include_next "board.h"


#undef STM32_HSECLK
#define STM32_HSECLK 16000000


#define BOARD_YANDR_BIU_F401
38 changes: 38 additions & 0 deletions keyboards/yandrstudio/yp87ble/f401/chconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* Copyright 2020 QMK
*
* 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

#define CH_CFG_ST_FREQUENCY 10000

#define CH_CFG_ST_RESOLUTION 16

// #define CH_CFG_INTERVALS_SIZE 16

#define CH_CFG_FACTORY_OBJECTS_REGISTRY TRUE

#define CH_CFG_FACTORY_GENERIC_BUFFERS TRUE

#define CH_CFG_FACTORY_SEMAPHORES TRUE

#define CH_CFG_FACTORY_MAILBOXES TRUE

#define CH_CFG_FACTORY_OBJ_FIFOS TRUE

#define CH_CFG_FACTORY_PIPES TRUE

#include_next <chconf.h>

84 changes: 84 additions & 0 deletions keyboards/yandrstudio/yp87ble/f401/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* Copyright 2021 JasonRen(biu)
*
* 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"

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

// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#define MATRIX_COL_PINS { A3, B9, B8, C13, C14, B7, B6, B5, B4, B3, A15, A14, A9, B12, A8, B15, A10, A13}
#define MATRIX_ROW_PINS { B0, B1, B2, A5, A6, A7}

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL


/* RGN Matrix */
#ifdef RGB_MATRIX_ENABLE

# define RGB_DI_PIN B10
# define RGBLED_NUM 96
# define DRIVER_LED_TOTAL RGBLED_NUM


# define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
# define WS2812_PWM_CHANNEL 3 // default: 2
# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
# define WS2812_DMA_STREAM STM32_DMA1_STREAM1 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
# define WS2812_DMA_CHANNEL 3 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.


# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
# define RGBLIGHT_VAL_STEP 15
# define RGB_DISABLE_WHEN_USB_SUSPENDED true
# define RGB_MATRIX_CENTER { 32, 96 }
# define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
# define RGBLIGHT_ANIMATIONS

// # define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_RGB

#endif


#ifdef RGBLIGHT_ENABLE

# define RGB_DI_PIN B10
# define RGBLED_NUM 96
# define DRIVER_LED_TOTAL RGBLED_NUM
# define RGBLIGHT_LIMIT_VAL 150
# define RGBLIGHT_SLEEP

# define WS2812_PWM_DRIVER PWMD2 // default: PWMD2
# define WS2812_PWM_CHANNEL 3 // default: 2
# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
# define WS2812_DMA_STREAM STM32_DMA1_STREAM1 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
# define WS2812_DMA_CHANNEL 3 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.



// # define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_RGB

#endif



#define LED_CAPS_LOCK_PIN B13
#define LED_SCROLL_LOCK_PIN B14
#define LED_PIN_ON_STATE 0
Loading

0 comments on commit fba647d

Please sign in to comment.