Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify zhou65 keyboard to WB32 #3

Merged
merged 1 commit into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion builddefs/common_features.mk
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@ else
# Teensy EEPROM implementations
OPT_DEFS += -DEEPROM_TEENSY
SRC += eeprom_teensy.c
else
else ifneq ($(filter %_WB32F3G71x9 %_WB32F3G71xB %_WB32F3G71xC, $(MCU_SERIES)_$(MCU_LDSCRIPT)),)
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_WB32_FLASH_EMULATED
OPT_DEFS += -DEEPROM_DRIVER
COMMON_VPATH += $(DRIVER_PATH)/eeprom
SRC += eeprom_driver.c
SRC += $(PLATFORM_COMMON_DIR)/eeprom_wb32.c
else
# Fall back to transient, i.e. non-persistent
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
COMMON_VPATH += $(DRIVER_PATH)/eeprom
Expand Down
2 changes: 2 additions & 0 deletions keyboards/yandrstudio/zhou65/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@
#define DEBOUNCE 5

#define QMK_KEYS_PER_SCAN 4

#define KEYBOARD_SHARED_EP
130 changes: 73 additions & 57 deletions keyboards/yandrstudio/zhou65/mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,61 +18,77 @@

#include_next <mcuconf.h>

#undef STM32_NO_INIT
#undef STM32_HSI_ENABLED
#undef STM32_LSI_ENABLED
#undef STM32_HSE_ENABLED
#undef STM32_LSE_ENABLED
#undef STM32_CLOCK48_REQUIRED
#undef STM32_SW
#undef STM32_PLLSRC
#undef STM32_PLLM_VALUE
#undef STM32_PLLN_VALUE
#undef STM32_PLLP_VALUE
#undef STM32_PLLQ_VALUE
#undef STM32_HPRE
#undef STM32_PPRE1
#undef STM32_PPRE2
#undef STM32_RTCSEL
#undef STM32_RTCPRE_VALUE
#undef STM32_MCO1SEL
#undef STM32_MCO1PRE
#undef STM32_MCO2SEL
#undef STM32_MCO2PRE
#undef STM32_I2SSRC
#undef STM32_PLLI2SN_VALUE
#undef STM32_PLLI2SR_VALUE
#undef STM32_PVD_ENABLE
#undef STM32_PLS
#undef STM32_BKPRAM_ENABLE
// #define WB32_NO_INIT FALSE
// #define WB32_MHSI_ENABLED TRUE
// #define WB32_FHSI_ENABLED FALSE
// #define WB32_LSI_ENABLED FALSE
// #define WB32_HSE_ENABLED TRUE
// #define WB32_LSE_ENABLED FALSE
// #define WB32_PLL_ENABLED TRUE
// #define WB32_MAINCLKSRC WB32_MAINCLKSRC_PLL
// #define WB32_PLLSRC WB32_PLLSRC_HSE
// #define WB32_PLLDIV_VALUE 2
// #define WB32_PLLMUL_VALUE 12 //The allowed range is 12,16,20,24.
// #define WB32_HPRE 1
// #define WB32_PPRE1 1
// #define WB32_PPRE2 1
// #define WB32_USBPRE WB32_USBPRE_DIV1P5

#define STM32_NO_INIT FALSE
#define STM32_HSI_ENABLED TRUE
#define STM32_LSI_ENABLED TRUE
#define STM32_HSE_ENABLED TRUE
#define STM32_LSE_ENABLED FALSE
#define STM32_CLOCK48_REQUIRED TRUE
#define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSE
#define STM32_PLLM_VALUE 8
#define STM32_PLLN_VALUE 192
#define STM32_PLLP_VALUE 4
#define STM32_PLLQ_VALUE 4
// AHB prescaler value.
#define STM32_HPRE STM32_HPRE_DIV1
//APB1 prescaler value.
#define STM32_PPRE1 STM32_PPRE1_DIV4
//APB2 prescaler value.
#define STM32_PPRE2 STM32_PPRE2_DIV2
#define STM32_RTCSEL STM32_RTCSEL_LSI
#define STM32_RTCPRE_VALUE 8
#define STM32_MCO1SEL STM32_MCO1SEL_HSI
#define STM32_MCO1PRE STM32_MCO1PRE_DIV1
#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK
#define STM32_MCO2PRE STM32_MCO2PRE_DIV5
#define STM32_I2SSRC STM32_I2SSRC_CKIN
#define STM32_PLLI2SN_VALUE 192
#define STM32_PLLI2SR_VALUE 5
#define STM32_PVD_ENABLE FALSE
#define STM32_PLS STM32_PLS_LEV0
#define STM32_BKPRAM_ENABLE FALSE
// #undef STM32_NO_INIT
// #undef STM32_HSI_ENABLED
// #undef STM32_LSI_ENABLED
// #undef STM32_HSE_ENABLED
// #undef STM32_LSE_ENABLED
// #undef STM32_CLOCK48_REQUIRED
// #undef STM32_SW
// #undef STM32_PLLSRC
// #undef STM32_PLLM_VALUE
// #undef STM32_PLLN_VALUE
// #undef STM32_PLLP_VALUE
// #undef STM32_PLLQ_VALUE
// #undef STM32_HPRE
// #undef STM32_PPRE1
// #undef STM32_PPRE2
// #undef STM32_RTCSEL
// #undef STM32_RTCPRE_VALUE
// #undef STM32_MCO1SEL
// #undef STM32_MCO1PRE
// #undef STM32_MCO2SEL
// #undef STM32_MCO2PRE
// #undef STM32_I2SSRC
// #undef STM32_PLLI2SN_VALUE
// #undef STM32_PLLI2SR_VALUE
// #undef STM32_PVD_ENABLE
// #undef STM32_PLS
// #undef STM32_BKPRAM_ENABLE

// #define STM32_NO_INIT FALSE
// #define STM32_HSI_ENABLED TRUE
// #define STM32_LSI_ENABLED TRUE
// #define STM32_HSE_ENABLED TRUE
// #define STM32_LSE_ENABLED FALSE
// #define STM32_CLOCK48_REQUIRED TRUE
// #define STM32_SW STM32_SW_PLL
// #define STM32_PLLSRC STM32_PLLSRC_HSE
// #define STM32_PLLM_VALUE 8
// #define STM32_PLLN_VALUE 192
// #define STM32_PLLP_VALUE 4
// #define STM32_PLLQ_VALUE 4
// // AHB prescaler value.
// #define STM32_HPRE STM32_HPRE_DIV1
// //APB1 prescaler value.
// #define STM32_PPRE1 STM32_PPRE1_DIV4
// //APB2 prescaler value.
// #define STM32_PPRE2 STM32_PPRE2_DIV2
// #define STM32_RTCSEL STM32_RTCSEL_LSI
// #define STM32_RTCPRE_VALUE 8
// #define STM32_MCO1SEL STM32_MCO1SEL_HSI
// #define STM32_MCO1PRE STM32_MCO1PRE_DIV1
// #define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK
// #define STM32_MCO2PRE STM32_MCO2PRE_DIV5
// #define STM32_I2SSRC STM32_I2SSRC_CKIN
// #define STM32_PLLI2SN_VALUE 192
// #define STM32_PLLI2SR_VALUE 5
// #define STM32_PVD_ENABLE FALSE
// #define STM32_PLS STM32_PLS_LEV0
// #define STM32_BKPRAM_ENABLE FALSE
3 changes: 2 additions & 1 deletion keyboards/yandrstudio/zhou65/rules.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MCU name
MCU = STM32F401
MCU = WB32F3G71

# Bootloader selection
BOOTLOADER = stm32-dfu
Expand All @@ -16,3 +16,4 @@ NKRO_ENABLE = yes # Enable N-Key Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
AUDIO_ENABLE = no # Audio output
EEPROM_DRIVER = vendor
Loading