Skip to content

Commit

Permalink
add boyPad
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Aug 22, 2021
1 parent fe2769f commit f78926d
Show file tree
Hide file tree
Showing 23 changed files with 1,377 additions and 7 deletions.
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/boy40ble/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

/* USB Device descriptor parameter */
#define VENDOR_ID 0xAA96
#define PRODUCT_ID 0xAAA6
#define PRODUCT_ID 0xAAAB
#define DEVICE_VER 0x0001
#define MANUFACTURER JasonRen biu
#define PRODUCT boy40ble
Expand Down
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/boy40ble/via-info.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Boy40_Y&R",
"vendorId": "0xAA96",
"productId": "0xAAA6",
"productId": "0xAAAB",
"lighting": "qmk_rgblight",
"matrix": { "rows": 4, "cols": 12 },
"layouts": {
Expand Down
59 changes: 59 additions & 0 deletions keyboards/yandrstudio/boyPad/boyPad.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* 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, 1, 2, 3 }, \
{ 6, 5, 4, NO_LED }, \
{ 7, 8, 9, 10 }, \
{ 13, 12, 11, NO_LED }, \
{ NO_LED, 14, 15, 16 } \
},
{
// LED Index to Physical Position
{0,0}, {75,0}, {149,0}, {224,0}, \
{224,16}, {149,16}, {75,16}, \
{0,32}, {75,32}, {149,32}, {224,32}, \
{224,48}, {149,48}, {75,48},\
{75,64}, {149,64}, {224,64}\
},
{
// LED Index to Flag
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
46 changes: 46 additions & 0 deletions keyboards/yandrstudio/boyPad/boyPad.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* Copyright 2020 zvecr <git@zvecr.com>
*
* 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"

/*
* ┌───┬───┬───┬───┐
* │00 │01 │02 │03 │
* ├───┼───┼───┼───┤
* │10 │11 │12 │ │
* ├───┼───┼───┤23 │
* │20 │21 │22 │ │
* ├───┼───┼───┼───┤
* │30 │31 │32 │ │
* ├───┴───┼───┤43 │
* │41 │42 │ │
* └───────┴───┴───┘
*/

#define LAYOUT( \
k00, k01, k02, k03, \
k10, k11, k12, \
k20, k21, k22, k23, \
k30, k31, k32, \
k41, k42, k43 \
) { \
{ k00, k01, k02, k03 }, \
{ k10, k11, k12, KC_NO }, \
{ k20, k21, k22, k23 }, \
{ k30, k31, k32, KC_NO }, \
{ KC_NO, k41, k42, k43 } \
}
53 changes: 53 additions & 0 deletions keyboards/yandrstudio/boyPad/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* 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 0xAAAC
#define DEVICE_VER 0x0001
#define MANUFACTURER JasonRen biu
#define PRODUCT boy40ble

/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 4

// 0 1 2 3 4 5 6 7 8 9 10 11 12 13
#define MATRIX_COL_PINS { B15, A8, A9, A1}
#define MATRIX_ROW_PINS { B12, B13, B14, A5, A2}

/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION ROW2COL


// 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




25 changes: 25 additions & 0 deletions keyboards/yandrstudio/boyPad/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 8000000


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

62 changes: 62 additions & 0 deletions keyboards/yandrstudio/boyPad/f401/config.h
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/>.
*/
#pragma once

#include "config_common.h"


/* RGN Matrix */
#ifdef RGB_MATRIX_ENABLE

# define RGB_DI_PIN A7
# define RGBLED_NUM 17
# 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 RGB_MATRIX_MAXIMUM_BRIGHTNESS 180
# define RGBLIGHT_VAL_STEP 18
# define RGB_DISABLE_WHEN_USB_SUSPENDED true
# define RGB_MATRIX_CENTER { 32, 96 }
# define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS

#endif


#ifdef RGBLIGHT_ENABLE

# define RGB_DI_PIN A7
# define RGBLED_NUM 17
# define RGBLIGHT_ANIMATIONS
# 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.

#endif



Loading

0 comments on commit f78926d

Please sign in to comment.