Skip to content

Commit

Permalink
更新白鼠69 rgb矩阵
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jul 9, 2021
1 parent a4c0819 commit be78933
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 53 deletions.
35 changes: 18 additions & 17 deletions keyboards/yandrstudio/whiteMouse69/f401/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define MATRIX_COLS 15

// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
#define MATRIX_COL_PINS { A15, B3, B4, B5, B9, B14, B3, A3, A4, A5, A6, A7, B0, B1, A8}
#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 */
Expand All @@ -32,22 +32,24 @@
/* RGN Matrix */
#ifdef RGB_MATRIX_ENABLE

# define RGB_DI_PIN B5
# define RGBLED_NUM 1
# define RGB_DI_PIN B15
# define RGBLED_NUM 72
# define DRIVER_LED_TOTAL RGBLED_NUM

#define WS2812_PWM_DRIVER PWMD3 // default: PWMD2
#define WS2812_PWM_CHANNEL 2 // default: 2
#define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
#define WS2812_DMA_CHANNEL 5 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
# define WS2812_PWM_DRIVER PWMD1 // 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_DMA2_STREAM5 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
# define WS2812_DMA_CHANNEL 6 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.


# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 100
# define RGBLIGHT_VAL_STEP 18
# 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

Expand All @@ -57,15 +59,14 @@
#ifdef RGBLIGHT_ENABLE

# define RGB_DI_PIN B15
# define RGBLED_NUM 80
# define RGBLED_NUM 72
# define DRIVER_LED_TOTAL RGBLED_NUM


// #define WS2812_PWM_DRIVER PWMD3 // default: PWMD2
// #define WS2812_PWM_CHANNEL 2 // default: 2
// #define WS2812_PWM_PAL_MODE 2 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2
// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
// #define WS2812_DMA_CHANNEL 5 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
# define WS2812_PWM_DRIVER PWMD1 // 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_DMA2_STREAM5 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU.
# define WS2812_DMA_CHANNEL 6 // 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
Expand Down
5 changes: 1 addition & 4 deletions keyboards/yandrstudio/whiteMouse69/f401/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
#include_next <halconf.h>

#undef HAL_USE_PWM
#define HAL_USE_PWM FALSE

#undef HAL_USE_SPI
#define HAL_USE_SPI FALSE
#define HAL_USE_PWM TRUE

#undef SERIAL_USB_BUFFERS_SIZE
#define SERIAL_USB_BUFFERS_SIZE 256
Expand Down
7 changes: 2 additions & 5 deletions keyboards/yandrstudio/whiteMouse69/f401/mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@

#include_next <mcuconf.h>

#undef STM32_PWM_USE_TIM3
#define STM32_PWM_USE_TIM3 FALSE

#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 FALSE
#undef STM32_PWM_USE_TIM1
#define STM32_PWM_USE_TIM1 TRUE

#undef STM32_NO_INIT
#undef STM32_HSI_ENABLED
Expand Down
10 changes: 5 additions & 5 deletions keyboards/yandrstudio/whiteMouse69/f401/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ BOOTLOADER = stm32-dfu
CUSTOM_MATRIX = lite # for using the A9 pin as matrix io
QUANTUM_SRC += matrix.c

# RGB_MATRIX_ENABLE = yes
# RGB_MATRIX_DRIVER = WS2812
RGBLIGHT_ENABLE = yes
RGBLIGHT_DRIVER = WS2812
# WS2812_DRIVER = pwm
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
# RGBLIGHT_ENABLE = yes
# RGBLIGHT_DRIVER = WS2812
WS2812_DRIVER = pwm

# EEPROM_DRIVER = spi
EEPROM_DRIVER = custom
Expand Down
12 changes: 6 additions & 6 deletions keyboards/yandrstudio/whiteMouse69/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

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_LSFT, KC_UP, KC_P1, KC_P2, KC_P3,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_LALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT),
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,
KC_TRNS, 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,
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),
Expand Down
8 changes: 4 additions & 4 deletions keyboards/yandrstudio/whiteMouse69/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

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_LSFT, KC_UP, KC_P1, KC_P2, KC_P3,
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_LSFT, KC_UP, KC_P1, KC_P2, KC_P3,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_LALT, 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,
Expand Down
1 change: 0 additions & 1 deletion keyboards/yandrstudio/whiteMouse69/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = yes # USB Nkey Rollover
NO_USB_STARTUP_CHECK = no # For ble to avoid usb init config

29 changes: 18 additions & 11 deletions keyboards/yandrstudio/whiteMouse69/whiteMouse69.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,31 @@
#ifdef RGB_MATRIX_ENABLE
led_config_t g_led_config = {
{
{72 ,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 ,NO_LED,9 ,8 ,NO_LED,7 ,6 ,5 ,4 ,3 ,2 ,1 }, \
{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 ,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,101},{32,90},{32,82},{32,74},{32,66},{32,58},{32,50},{32,42},{32,34},{32,26},{32,18},{32,5},
{24,128},{24,120},{24,107},{24,94},{24,86},{24,78},{24,70},{24,62},{24,54},{24,46},{24,38},{24,30},{24,22},{24,14},{24,3},
{16,110},{16,100},{16,92},{16,84},{16,76},{16,68},{16,60},{16,52},{16,44},{16,36},{16,28},{16,20},{16,12},{16,2},
{8,120},{8,108},{8,96},{8,88},{8,80},{8,72},{8,64},{8,56},{8,48},{8,40},{8,32},{8,24},{8,16},{8,8},{8,0},
{0,120},{0,112},{0,104},{0,96},{0,80},{0,72},{0,56},{0,48},{0,40},{0,32},{0,24},{0,16},{0,0},
{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, 4
}
};

Expand Down

0 comments on commit be78933

Please sign in to comment.