add hid_rgbled keymap

This commit is contained in:
hsgw
2024-01-31 23:05:25 +09:00
parent b7468f4785
commit 76f5c55e80
10 changed files with 167 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
// Copyright 2024 hsgw (@hsgw)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT

View File

@@ -0,0 +1,45 @@
{
"manufacturer": "hsgw",
"keyboard_name": "hid_rgbled",
"maintainer": "hsgw",
"url": "",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
"features": {
"bootmagic": true,
"command": false,
"console": false,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgblight": true
},
"rgblight": {
"saturation_steps": 8,
"brightness_steps": 8,
"led_count": 1,
"sleep": true,
"animations": {
"breathing": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"knight": true,
"christmas": true,
"static_gradient": true,
"rgb_test": true,
"alternating": true,
"twinkle": true
}
},
"layouts": {
"LAYOUT_ortho_1x1": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0}
]
}
}
}

View File

@@ -0,0 +1,16 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_1x1(KC_A)
};
// clang-format on
void keyboard_post_init_user(void) {
rgblight_enable();
rgblight_mode(RGBLIGHT_MODE_RGB_TEST);
}

View File

@@ -0,0 +1,27 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
#include <raw_hid.h>
// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_ortho_1x1(KC_A)
};
// clang-format on
void keyboard_post_init_user(void) {
rgblight_enable();
}
void raw_hid_receive(uint8_t *data, uint8_t length) {
// `data` is a pointer to the buffer containing the received HID report
// `length` is the length of the report - always `RAW_EPSIZE`
uint8_t response[length];
memset(response, 0, length);
response[0] = 'B';
if (data[0] == 'A') {
raw_hid_send(response, length);
}
}

View File

@@ -0,0 +1 @@
RAW_ENABLE = yes

View File

@@ -0,0 +1,27 @@
# hid_rgbled
![hid_rgbled](imgur.com image replace me!)
*A short description of the keyboard/project*
* Keyboard Maintainer: [hsgw](https://github.com/hsgw)
* Hardware Supported: *The PCBs, controllers supported*
* Hardware Availability: *Links to where you can find this hardware*
Make example for this keyboard (after setting up your build environment):
make hid_rgbled:default
Flashing example for this keyboard:
make hid_rgbled:default:flash
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
## Bootloader
Enter the bootloader in 3 ways:
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

View File

@@ -0,0 +1 @@
# This file intentionally left blank

View File

@@ -0,0 +1,20 @@
{
"bootloader": "rp2040",
"processor": "RP2040",
"url": "",
"usb": {
"device_version": "1.0.0",
"pid": "0x0000",
"vid": "0xFEED"
},
"matrix_pins":{
"direct": [["GP26"]]
},
"ws2812": {
"pin": "GP12",
"driver": "vendor"
},
"rgblight": {
"max_brightness": 200
}
}

View File

@@ -0,0 +1 @@
# This file intentionally left blank

View File

@@ -0,0 +1,9 @@
#include "quantum.h"
void keyboard_post_init_kb(void) {
// power up rgbled
setPinOutput(GP11);
writePinHigh(GP11);
keyboard_post_init_user();
}