Add backlight function (#565)

Add backlight function
This commit is contained in:
era 2023-10-09 11:00:01 +09:00 committed by GitHub
parent bb182ad936
commit 24c95223bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 76 additions and 8 deletions

View file

@ -0,0 +1,20 @@
/* Copyright 2023 eerraa
*
* 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 BACKLIGHT_PWM_DRIVER PWMD0
#define BACKLIGHT_PWM_CHANNEL RP2040_PWM_CHANNEL_A

View file

@ -0,0 +1,21 @@
/* Copyright 2023 eerraa
*
* 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 HAL_USE_PWM TRUE
#include_next <halconf.h>

View file

@ -1,13 +1,18 @@
{ {
"manufacturer": "ERA", "manufacturer": "ERA",
"keyboard_name": "DIVINE 1.0.0", "keyboard_name": "DIVINE",
"maintainer": "eerraa", "maintainer": "eerraa",
"backlight": {
"pin": "GP0",
"levels": 5
},
"bootloader": "rp2040", "bootloader": "rp2040",
"build": { "build": {
"debounce_type": "sym_defer_pk" "debounce_type": "sym_defer_pk"
}, },
"diode_direction": "COL2ROW", "diode_direction": "COL2ROW",
"features": { "features": {
"backlight": true,
"bootmagic": true, "bootmagic": true,
"command": false, "command": false,
"console": false, "console": false,
@ -18,8 +23,8 @@
"indicators": { "indicators": {
"caps_lock": "GP1", "caps_lock": "GP1",
"num_lock": "GP2", "num_lock": "GP2",
"scroll_lock": "GP3", "on_state": 0,
"on_state": 0 "scroll_lock": "GP3"
}, },
"matrix_pins": { "matrix_pins": {
"cols": ["GP13", "GP12", "GP19", "GP20", "GP21", "GP22", "GP23", "GP24", "GP25", "GP26", "GP27", "GP28", "GP29", "GP18", "GP5", "GP6", "GP7"], "cols": ["GP13", "GP12", "GP19", "GP20", "GP21", "GP22", "GP23", "GP24", "GP25", "GP26", "GP27", "GP28", "GP29", "GP18", "GP5", "GP6", "GP7"],
@ -28,7 +33,7 @@
"processor": "RP2040", "processor": "RP2040",
"url": "", "url": "",
"usb": { "usb": {
"device_version": "1.0.0", "device_version": "1.0.1",
"pid": "0x0002", "pid": "0x0002",
"vid": "0x4552" "vid": "0x4552"
}, },

View file

@ -2,7 +2,7 @@
"name": "DIVINE", "name": "DIVINE",
"vendorId": "0x4552", "vendorId": "0x4552",
"productId": "0x0002", "productId": "0x0002",
"lighting": "none", "lighting": "qmk_backlight",
"matrix": "matrix":
{ {
"rows": 5, "rows": 5,

View file

@ -0,0 +1,22 @@
/* Copyright 2023 eerraa
*
* 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_next <mcuconf.h>
#undef RP_PWM_USE_PWM0
#define RP_PWM_USE_PWM0 TRUE

View file

@ -1,9 +1,9 @@
# DIVINE # DIVINE
DIVINE Keyboard DIVINE PCB
* Keyboard Maintainer: [ERA](https://github.com/eerraa) * Keyboard Maintainer: [ERA](https://github.com/eerraa)
* Hardware Supported: RP2040 * Hardware Supported: DIVINE
* Hardware Availability: [ERA](https://github.com/eerraa) * Hardware Availability: [ERA](https://github.com/eerraa)
Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment):
@ -21,5 +21,5 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to
Enter the bootloader in 3 ways: Enter the bootloader in 3 ways:
* **Bootmagic reset**: Hold down the key at ESC(0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard * **Bootmagic reset**: Hold down the key at ESC(0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Short the reset hole of the PCB twice within 1 second. * **Physical reset button**: Briefly short the `RESET` and `GND` pads on the SWD header twice, or short the `BOOT` header and plug in keyboard
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available