Skip to content

Commit

Permalink
fix tdcq
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jun 14, 2021
1 parent cf46f1e commit ed2ccb4
Show file tree
Hide file tree
Showing 20 changed files with 249 additions and 152 deletions.
27 changes: 1 addition & 26 deletions keyboards/yandrstudio/tdcq64_2s/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,8 @@
#define DEBOUNCE 5



/* RGN Matrix */
#ifdef RGB_MATRIX_ENABLE

# define RGB_DI_PIN A7
# define RGBLED_NUM 2
# define DRIVER_LED_TOTAL RGBLED_NUM


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

# 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

#define LED_CAPS_LOCK_PIN A5
#define LED_PIN_ON_STATE 0

#define BACKLIGHT_PIN A6
#define BACKLIGHT_BREATHING
#define BACKLIGHT_PWM_DRIVER PWMD3
#define BACKLIGHT_PWM_CHANNEL 1
#define BACKLIGHT_PAL_MODE 2


7 changes: 4 additions & 3 deletions keyboards/yandrstudio/tdcq64_2s/f401/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

#include_next "board.h"

#undef STM32_HSE_BYPASS
#ifdef STM32_HSECLK

#undef STM32_HSECLK
#endif // STM32_HSECLK
#define STM32_HSECLK 8000000


#define BOARD_YANDR_BIU_F401
34 changes: 34 additions & 0 deletions keyboards/yandrstudio/tdcq64_2s/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>

70 changes: 70 additions & 0 deletions keyboards/yandrstudio/tdcq64_2s/f401/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/* 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 2
# 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 2
# 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



#ifdef BACKLIGHT_ENABLE
# define BACKLIGHT_PIN A6
# define BACKLIGHT_BREATHING

# define BACKLIGHT_PWM_DRIVER PWMD3
# define BACKLIGHT_PWM_CHANNEL 1
# define BACKLIGHT_PAL_MODE 2
# define BACKLIGHT_ON_STATE 1
#endif
16 changes: 6 additions & 10 deletions keyboards/yandrstudio/tdcq64_2s/f401/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i keyboards/zvecr/zv48/f401/halconf.h -r platforms/chibios/common/configs/halconf.h`
*/

#pragma once

#include_next <halconf.h>

#undef HAL_USE_PWM
#define HAL_USE_PWM TRUE

// #define HAL_USE_SERIAL TRUE

#undef SERIAL_USB_BUFFERS_SIZE
#define SERIAL_USB_BUFFERS_SIZE 256

#undef HAL_USE_SPI
#define HAL_USE_SPI TRUE

#undef SPI_USE_WAIT
#define SPI_USE_WAIT TRUE

#include_next <halconf.h>
#undef SPI_SELECT_MODE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
12 changes: 1 addition & 11 deletions keyboards/yandrstudio/tdcq64_2s/f401/mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i keyboards/zvecr/zv48/f401/mcuconf.h -r platforms/chibios/BLACKPILL_STM32_F401/configs/mcuconf.h`
*/

#pragma once

#include_next <mcuconf.h>


#undef STM32_PWM_USE_TIM3
#define STM32_PWM_USE_TIM3 TRUE

#undef STM32_SERIAL_USE_USART1
#define STM32_SERIAL_USE_USART1 FALSE

#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE


#undef STM32_NO_INIT
#undef STM32_HSI_ENABLED
Expand Down
4 changes: 4 additions & 0 deletions keyboards/yandrstudio/tdcq64_2s/f401/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ CUSTOM_MATRIX = lite # for using the A9 pin as matrix io

# # project specific file
QUANTUM_SRC += matrix.c


WS2812_DRIVER = pwm
BACKLIGHT_DRIVER = pwm
2 changes: 0 additions & 2 deletions keyboards/yandrstudio/tdcq64_2s/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ NKRO_ENABLE = yes # USB Nkey Rollover
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
BACKLIGHT_ENABLE = yes
BACKLIGHT_DRIVER = pwm
WS2812_DRIVER = spi

20 changes: 0 additions & 20 deletions keyboards/yandrstudio/tdcq68/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,24 +50,4 @@



/* RGN Matrix */
#ifdef RGB_MATRIX_ENABLE

# define RGB_DI_PIN A7
# define RGBLED_NUM 2
# define DRIVER_LED_TOTAL RGBLED_NUM

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

# 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



7 changes: 4 additions & 3 deletions keyboards/yandrstudio/tdcq68/f401/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@

#include_next "board.h"

#undef STM32_HSE_BYPASS
#ifdef STM32_HSECLK

#undef STM32_HSECLK
#endif // STM32_HSECLK
#define STM32_HSECLK 8000000


#define BOARD_YANDR_BIU_F401
34 changes: 34 additions & 0 deletions keyboards/yandrstudio/tdcq68/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>

61 changes: 61 additions & 0 deletions keyboards/yandrstudio/tdcq68/f401/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* 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 2
# 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 2
# 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



18 changes: 9 additions & 9 deletions keyboards/yandrstudio/tdcq68/f401/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
* This file was auto-generated by:
* `qmk chibios-confmigrate -i keyboards/zvecr/zv48/f401/halconf.h -r platforms/chibios/common/configs/halconf.h`
*/

#pragma once
#include_next <halconf.h>

#undef HAL_USE_SPI
#define HAL_USE_SPI TRUE
#undef HAL_USE_PWM
#define HAL_USE_PWM TRUE

// #define HAL_USE_SERIAL TRUE

#undef SERIAL_USB_BUFFERS_SIZE
#define SERIAL_USB_BUFFERS_SIZE 256

#include_next <halconf.h>

#undef SPI_USE_WAIT
#define SPI_USE_WAIT TRUE

#undef SPI_SELECT_MODE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
Loading

0 comments on commit ed2ccb4

Please sign in to comment.