diff options
author | Stefan Kerkmann <karlk90@pm.me> | 2022-10-04 23:10:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-04 23:10:24 +0200 |
commit | 996a9006d3f101dc5c48b58339e2e7323040fd59 (patch) | |
tree | 56bb76db42e23e3a1bc343ee7d35ee307e08a0a0 /keyboards/handwired/onekey | |
parent | b6ea8837e4c81f364d30bdc74bf2cdccb2a1a185 (diff) |
[Core] PWM Backlight for RP2040 (#17706)
Diffstat (limited to 'keyboards/handwired/onekey')
-rw-r--r-- | keyboards/handwired/onekey/blackpill_f401/config.h | 1 | ||||
-rw-r--r-- | keyboards/handwired/onekey/blackpill_f411/config.h | 1 | ||||
-rwxr-xr-x | keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h | 1 | ||||
-rw-r--r-- | keyboards/handwired/onekey/rp2040/config.h | 3 | ||||
-rw-r--r-- | keyboards/handwired/onekey/rp2040/halconf.h | 9 | ||||
-rw-r--r-- | keyboards/handwired/onekey/rp2040/info.json | 5 | ||||
-rw-r--r-- | keyboards/handwired/onekey/rp2040/mcuconf.h | 9 |
7 files changed, 28 insertions, 1 deletions
diff --git a/keyboards/handwired/onekey/blackpill_f401/config.h b/keyboards/handwired/onekey/blackpill_f401/config.h index 4e9552480f..05f3f07763 100644 --- a/keyboards/handwired/onekey/blackpill_f401/config.h +++ b/keyboards/handwired/onekey/blackpill_f401/config.h @@ -20,6 +20,7 @@ #define BACKLIGHT_PWM_DRIVER PWMD5 #define BACKLIGHT_PWM_CHANNEL 1 +#define BACKLIGHT_PAL_MODE 2 #define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/blackpill_f411/config.h b/keyboards/handwired/onekey/blackpill_f411/config.h index b97df0c666..c890043b09 100644 --- a/keyboards/handwired/onekey/blackpill_f411/config.h +++ b/keyboards/handwired/onekey/blackpill_f411/config.h @@ -20,6 +20,7 @@ #define BACKLIGHT_PWM_DRIVER PWMD5 #define BACKLIGHT_PWM_CHANNEL 1 +#define BACKLIGHT_PAL_MODE 2 #define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h b/keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h index c8800fa163..2b60320fc1 100755 --- a/keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h +++ b/keyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h @@ -20,6 +20,7 @@ #define BACKLIGHT_PWM_DRIVER PWMD5 #define BACKLIGHT_PWM_CHANNEL 1 +#define BACKLIGHT_PAL_MODE 2 #define ADC_PIN A0 diff --git a/keyboards/handwired/onekey/rp2040/config.h b/keyboards/handwired/onekey/rp2040/config.h index bcf4047a4f..82c5592dc9 100644 --- a/keyboards/handwired/onekey/rp2040/config.h +++ b/keyboards/handwired/onekey/rp2040/config.h @@ -13,3 +13,6 @@ #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP25 #define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 500U + +#define BACKLIGHT_PWM_DRIVER PWMD4 +#define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_B diff --git a/keyboards/handwired/onekey/rp2040/halconf.h b/keyboards/handwired/onekey/rp2040/halconf.h new file mode 100644 index 0000000000..5890122e5e --- /dev/null +++ b/keyboards/handwired/onekey/rp2040/halconf.h @@ -0,0 +1,9 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#define HAL_USE_I2C TRUE +#define HAL_USE_PWM TRUE + +#include_next <halconf.h> diff --git a/keyboards/handwired/onekey/rp2040/info.json b/keyboards/handwired/onekey/rp2040/info.json index b34a1cc206..32bde911bb 100644 --- a/keyboards/handwired/onekey/rp2040/info.json +++ b/keyboards/handwired/onekey/rp2040/info.json @@ -6,7 +6,10 @@ "cols": ["GP4"], "rows": ["GP5"] }, + "backlight": { + "pin": "GP25" + }, "rgblight": { - "pin": "A1" + "pin": "GP25" } } diff --git a/keyboards/handwired/onekey/rp2040/mcuconf.h b/keyboards/handwired/onekey/rp2040/mcuconf.h new file mode 100644 index 0000000000..86f821640f --- /dev/null +++ b/keyboards/handwired/onekey/rp2040/mcuconf.h @@ -0,0 +1,9 @@ +// Copyright 2022 Stefan Kerkmann +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include_next "mcuconf.h" + +#undef RP_PWM_USE_PWM4 +#define RP_PWM_USE_PWM4 TRUE |