forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added analog support for WB32 MCU. (qmk#18289)
Co-authored-by: Joy <chang.li@westberrytech.com>
- Loading branch information
1 parent
1861f8f
commit 3006b6e
Showing
11 changed files
with
126 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2022 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include "config_common.h" | ||
|
||
#define ADC_PIN A0 | ||
|
||
#define BACKLIGHT_PWM_DRIVER PWMD4 | ||
#define BACKLIGHT_PWM_CHANNEL 3 | ||
#define BACKLIGHT_PAL_MODE 2 | ||
|
||
#define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) | ||
#define RGB_CI_PIN B8 | ||
|
||
#define SOLENOID_PIN B12 | ||
#define SOLENOID_PINS { B12, B13, B14, B15 } | ||
#define SOLENOID_PINS_ACTIVE_STATE { high, high, low } | ||
|
||
#define I2C1_SDA_PIN B7 | ||
#define I2C1_SCL_PIN B6 | ||
#define I2C1_SCL_PAL_MODE 4 | ||
#define I2C1_OPMODE OPMODE_I2C | ||
#define I2C1_CLOCK_SPEED 100000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright 2022 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#define HAL_USE_ADC TRUE | ||
|
||
#define HAL_USE_I2C TRUE | ||
|
||
#define HAL_USE_PWM TRUE | ||
|
||
#include_next <halconf.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,11 @@ | |
"matrix_pins": { | ||
"cols": ["B12"], | ||
"rows": ["B13"] | ||
}, | ||
"backlight": { | ||
"pin": "B8" | ||
}, | ||
"rgblight": { | ||
"pin": "A0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2022 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#include_next "mcuconf.h" | ||
|
||
#undef WB32_ADC_USE_ADC1 | ||
#define WB32_ADC_USE_ADC1 TRUE | ||
|
||
#undef WB32_DMA_REQUIRED | ||
#define WB32_DMA_REQUIRED TRUE | ||
|
||
#undef WB32_I2C_USE_I2C1 | ||
#define WB32_I2C_USE_I2C1 TRUE | ||
|
||
#undef WB32_PWM_USE_TIM4 | ||
#define WB32_PWM_USE_TIM4 TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
MOUSEKEY_ENABLE = no # Mouse keys | ||
EXTRAKEY_ENABLE = no # Audio control and System control | ||
NKRO_ENABLE = no # Enable N-Key Rollover | ||
KEYBOARD_SHARED_EP = yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2022 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
|
||
#pragma once | ||
|
||
#include "config_common.h" | ||
|
||
#define ADC_PIN A0 | ||
|
||
#define BACKLIGHT_PWM_DRIVER PWMD4 | ||
#define BACKLIGHT_PWM_CHANNEL 3 | ||
#define BACKLIGHT_PAL_MODE 2 | ||
|
||
#define APA102_NOPS (100 / (1000000000L / (CPU_CLOCK / 4))) | ||
#define RGB_CI_PIN B8 | ||
|
||
#define SOLENOID_PIN B12 | ||
#define SOLENOID_PINS { B12, B13, B14, B15 } | ||
#define SOLENOID_PINS_ACTIVE_STATE { high, high, low } | ||
|
||
#define I2C1_SDA_PIN B7 | ||
#define I2C1_SCL_PIN B6 | ||
#define I2C1_SCL_PAL_MODE 4 | ||
#define I2C1_OPMODE OPMODE_I2C | ||
#define I2C1_CLOCK_SPEED 100000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright 2022 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#define HAL_USE_ADC TRUE | ||
|
||
#define HAL_USE_I2C TRUE | ||
|
||
#define HAL_USE_PWM TRUE | ||
|
||
#include_next <halconf.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,11 @@ | |
"matrix_pins": { | ||
"cols": ["B12"], | ||
"rows": ["B13"] | ||
}, | ||
"backlight": { | ||
"pin": "B8" | ||
}, | ||
"rgblight": { | ||
"pin": "A0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright 2022 QMK | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
#pragma once | ||
|
||
#include_next "mcuconf.h" | ||
|
||
#undef WB32_ADC_USE_ADC1 | ||
#define WB32_ADC_USE_ADC1 TRUE | ||
|
||
#undef WB32_DMA_REQUIRED | ||
#define WB32_DMA_REQUIRED TRUE | ||
|
||
#undef WB32_I2C_USE_I2C1 | ||
#define WB32_I2C_USE_I2C1 TRUE | ||
|
||
#undef WB32_PWM_USE_TIM4 | ||
#define WB32_PWM_USE_TIM4 TRUE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
MOUSEKEY_ENABLE = no # Mouse keys | ||
EXTRAKEY_ENABLE = no # Audio control and System control | ||
NKRO_ENABLE = no # Enable N-Key Rollover | ||
KEYBOARD_SHARED_EP = yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters