Skip to content

Commit

Permalink
add hotswap version for m69
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Aug 17, 2021
1 parent 8fea4d1 commit 4b68c3b
Show file tree
Hide file tree
Showing 37 changed files with 1,540 additions and 86 deletions.
2 changes: 1 addition & 1 deletion keyboards/handwired/tritium_numpad/tritium_numpad.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{k20, k21, k22, k23}, \
{k30, k31, k32, XXX}, \
{k40, k41, k42, k43}, \
{k50, XXX, k52, XXX} \
{k50, XXX, k52, XXX} \
}

/* matrix layout
Expand Down
5 changes: 1 addition & 4 deletions keyboards/yandrstudio/Eureka75/info-via.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"name": "Eureka75_Y&R",
"vendorId": "0xAA96",
"productId": "0xAAAA",
"lighting": {
"extends": "none",
"keycodes": "qmk"
},
"lighting": "qmk_rgblight",
"matrix": {
"rows": 6,
"cols": 15
Expand Down
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/Eureka75/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Eureka75 version 1.0
===

A 75% keys keyboard with rgb (keys).
This keyboard use 8mhz HSE and STM32F401 as MCU.
This keyboard use 16mhz HSE and STM32F401 as MCU.

Keyboard Maintainer: https://github.com/jiaxin96
Hardware Supported: Eureka75
Expand Down
2 changes: 0 additions & 2 deletions keyboards/yandrstudio/Eureka75/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,3 @@ CONSOLE_ENABLE = yes # Console for debug
# 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 # Disable initialization only when usb is plugged in


47 changes: 0 additions & 47 deletions keyboards/yandrstudio/M69/M69.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,50 +14,3 @@
* 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
22 changes: 5 additions & 17 deletions keyboards/yandrstudio/M69/M69.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,8 @@
*/
#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 } \
}
#if defined(KEYBOARD_yandrstudio_M69_solder)
#include "solder.h"
#else
#include "hotswap.h"
#endif
File renamed without changes.
File renamed without changes.
68 changes: 68 additions & 0 deletions keyboards/yandrstudio/M69/hotswap/f401/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
/* 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, B10, A5, A6, A7}

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL


/* RGN Matrix */
#ifdef RGB_MATRIX_ENABLE

# define RGB_DI_PIN B2
# define RGBLED_NUM 87
# define DRIVER_LED_TOTAL RGBLED_NUM

# 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 B2
# define RGBLED_NUM 87
# define DRIVER_LED_TOTAL RGBLED_NUM
# define RGBLIGHT_LIMIT_VAL 150
# define RGBLIGHT_SLEEP

// # 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions keyboards/yandrstudio/M69/hotswap/f401/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# MCU name
MCU = STM32F401

# Address of the bootloader in system memory
STM32_BOOTLOADER_ADDRESS = 0x1FFF0000

# Bootloader selection
BOOTLOADER = stm32-dfu

# # project specific file
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

# EEPROM_DRIVER = spi
EEPROM_DRIVER = custom
SRC += eep/eeprom_stm32.c
SRC += eep/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F401xC
COMMON_VPATH += patsubst$(%/, %, dir $(mkfile_patch))/eep


# Enter lower-power sleep mode when on the ChibiOS idle thread
OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE
62 changes: 62 additions & 0 deletions keyboards/yandrstudio/M69/hotswap/hotswap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* 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}, \
{32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, NO_LED, 19, 18, 17, 16}, \
{33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, NO_LED, 46, 47, 48, 49}, \
{62, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, NO_LED, NO_LED, 50, NO_LED, NO_LED, NO_LED}, \
{63, NO_LED, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, NO_LED, NO_LED, NO_LED, 75, NO_LED}, \
{86, 85, 84, NO_LED, NO_LED, NO_LED, 83, NO_LED, NO_LED, NO_LED, 82, 81, 80, NO_LED, 79, 78, 77, 76}
},
{
// 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}, \
{211,13},{198,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}, {158,38},{145,38},{132,38},{119,38},{105,38},{92,38},{79,38},{66,38},{53,38},{40,38},{26,38},{0,38}, \
{0,51}, {13,51},{26,51},{40,51},{53,51},{66,51},{79,51},{92,51},{105,51},{119,51},{132,51},{145,51}, {211,51}, \
{224,64},{211,64},{198,64},{184,64}, {158,64},{145,64},{132,64}, {92,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
}
};


#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/M69/hotswap/hotswap.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_all( \
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, 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, K414, \
K500, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, K516, \
K600, K601, K602, K606, K610, K611, K612, 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, KC_NO, 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, KC_NO, KC_NO, K414, KC_NO, KC_NO, KC_NO }, \
{ K500, KC_NO, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512, KC_NO, KC_NO, KC_NO, K516, KC_NO }, \
{ K600, K601, K602, KC_NO, KC_NO, KC_NO, K606, KC_NO, KC_NO, KC_NO, K610, K611, K612, KC_NO, K614, K615, K616, K617 } \
}
Loading

0 comments on commit 4b68c3b

Please sign in to comment.