summaryrefslogtreecommitdiff
path: root/keyboards/handwired
diff options
context:
space:
mode:
authorStefan Kerkmann <karlk90@pm.me>2022-10-04 23:10:24 +0200
committerGitHub <noreply@github.com>2022-10-04 23:10:24 +0200
commit996a9006d3f101dc5c48b58339e2e7323040fd59 (patch)
tree56bb76db42e23e3a1bc343ee7d35ee307e08a0a0 /keyboards/handwired
parentb6ea8837e4c81f364d30bdc74bf2cdccb2a1a185 (diff)
[Core] PWM Backlight for RP2040 (#17706)
Diffstat (limited to 'keyboards/handwired')
-rw-r--r--keyboards/handwired/onekey/blackpill_f401/config.h1
-rw-r--r--keyboards/handwired/onekey/blackpill_f411/config.h1
-rwxr-xr-xkeyboards/handwired/onekey/blackpill_f411_tinyuf2/config.h1
-rw-r--r--keyboards/handwired/onekey/rp2040/config.h3
-rw-r--r--keyboards/handwired/onekey/rp2040/halconf.h9
-rw-r--r--keyboards/handwired/onekey/rp2040/info.json5
-rw-r--r--keyboards/handwired/onekey/rp2040/mcuconf.h9
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