Configure keyboard matrix from info.json (#10817)

* Make parameters from info.json available to the build system

* move all clueboard settings to info.json

* code formatting

* make flake8 happy

* make flake8 happy

* make qmk lint happy

* Add support for specifying led indicators in json

* move led indicators to the clueboard info.json

* Apply suggestions from code review

Co-authored-by: Erovia <Erovia@users.noreply.github.com>

* add missing docstring

Co-authored-by: Erovia <Erovia@users.noreply.github.com>
This commit is contained in:
Zach White
2020-12-30 10:27:37 -08:00
committed by GitHub
parent f231f24dda
commit 47b9b11009
79 changed files with 4791 additions and 3901 deletions

View File

@@ -3,37 +3,4 @@
#include "quantum.h"
/* Cluepad matrix layout
* .-------------------.
* |NLCK| /| *| -|
* |-------------------|
* | 7| 8| 9| |
* |--------------| |
* | 4| 5| 6| +|
* |-------------------|
* | 1| 2| 3| |
* |--------------| |
* | 0| .| Ent|
* '-------------------'
*/
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
#define LAYOUT_numpad_5x4( \
k00, k01, k02, k03, \
k10, k11, k12, \
k20, k21, k22, k13, \
k30, k31, k32, \
k40, k42, k33 \
) { \
{ k00, k01, k02, k03 }, \
{ k10, k11, k12, k13 }, \
{ k20, k21, k22, KC_NO }, \
{ k30, k31, k32, k33 }, \
{ k40, KC_NO, k42, KC_NO } \
}
#define LAYOUT LAYOUT_numpad_5x4
#define KEYMAP LAYOUT_numpad_5x4
#endif

View File

@@ -20,76 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xC1ED
#define PRODUCT_ID 0x2312
#define DEVICE_VER 0x0001
#define MANUFACTURER Clueboard
#define PRODUCT Cluepad with RGB Underlighting
#define DESCRIPTION QMK keyboard firmware for Cluepad
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 4
// ROWS: Top to bottom, COLS: Left to right
/* Row pin configuration
* row: 0 1 2 3 4
* pin:
*/
#define MATRIX_ROW_PINS { B0, D3, D5, D4, D6 }
/* Column pin configuration
* col: 0 1 2 3
* pin: F4 E6 B1 D2
*/
#define MATRIX_COL_PINS { F4, E6, B1, D2 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* define if matrix has ghost */
//#define MATRIX_HAS_GHOST
/* Set 0 if debouncing isn't needed */
#define DEBOUNCE 5
/* Number of backlighting levels */
#define BACKLIGHT_LEVELS 3
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
/* Underlight configuration
*/
#define RGB_DI_PIN F6
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 4 // Number of LEDs
#define RGBLIGHT_HUE_STEP 10
#define RGBLIGHT_SAT_STEP 17
#define RGBLIGHT_VAL_STEP 17
/*
* Feature disable options
* These options are also useful to firmware size reduction.
*/
/* disable debug print */
//#define NO_DEBUG
/* Debug forcibly enabled */
#define ALWAYS_DEBUG
/* disable print */
//#define NO_PRINT
/* disable action features */
//#define NO_ACTION_LAYER
//#define NO_ACTION_TAPPING
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
#endif

View File

@@ -1,30 +1,67 @@
{
"manufacturer": "Clueboard",
"keyboard_name": "Clueboard 17% (Cluepad)",
"keyboard_folder": "clueboard/17",
"url": "",
"maintainer": "qmk",
"width": 4,
"maintainer": "skullydazed",
"height": 5,
"width": 4,
"diode_direction": "COL2ROW",
"features": {
"backlight": true,
"bootmagic": false,
"command": false,
"console": true,
"extrakey": true,
"midi": false,
"mousekey": true,
"nkro": true,
"rgblight": true,
"unicode": false
},
"matrix_pins": {
"cols": ["F4", "E6", "B1", "D2"],
"rows": ["B0", "D3", "D5", "D4", "D6"]
},
"rgblight": {
"animations": {
"all": true
},
"brightness_steps": "17",
"hue_steps": "10",
"led_count": "4",
"pin": "F6",
"saturation_steps": "17"
},
"url": "",
"usb": {
"device_ver": "0x0001",
"pid": "0x2312",
"vid": "0xC1ED"
},
"layout_aliases": {
"KEYMAP": "LAYOUT_numpad_5x4",
"LAYOUT": "LAYOUT_numpad_5x4"
},
"layouts": {
"LAYOUT_numpad_5x4": {
"key_count": 17,
"layout": [
{"label":"Num Lock", "x":0, "y":0},
{"label":"/", "x":1, "y":0},
{"label":"*", "x":2, "y":0},
{"label":"-", "x":3, "y":0},
{"label":"7", "x":0, "y":1},
{"label":"8", "x":1, "y":1},
{"label":"9", "x":2, "y":1},
{"label":"4", "x":0, "y":2},
{"label":"5", "x":1, "y":2},
{"label":"6", "x":2, "y":2},
{"label":"+", "x":3, "y":1, "h":2},
{"label":"1", "x":0, "y":3},
{"label":"2", "x":1, "y":3},
{"label":"3", "x":2, "y":3},
{"label":"0", "x":0, "y":4, "w":2},
{"label":".", "x":2, "y":4},
{"label":"Enter", "x":3, "y":3, "h":2}
{ "label": "Num Lock", "matrix": [0, 0], "w": 1, "x": 0, "y": 0 },
{ "label": "/", "matrix": [0, 1], "w": 1, "x": 1, "y": 0 },
{ "label": "*", "matrix": [0, 2], "w": 1, "x": 2, "y": 0 },
{ "label": "-", "matrix": [0, 3], "w": 1, "x": 3, "y": 0 },
{ "label": "7", "matrix": [1, 0], "w": 1, "x": 0, "y": 1 },
{ "label": "8", "matrix": [1, 1], "w": 1, "x": 1, "y": 1 },
{ "label": "9", "matrix": [1, 2], "w": 1, "x": 2, "y": 1 },
{ "label": "4", "matrix": [2, 0], "w": 1, "x": 0, "y": 2 },
{ "label": "5", "matrix": [2, 1], "w": 1, "x": 1, "y": 2 },
{ "label": "6", "matrix": [2, 2], "w": 1, "x": 2, "y": 2 },
{ "h": 2, "label": "+", "matrix": [1, 3], "w": 1, "x": 3, "y": 1 },
{ "label": "1", "matrix": [3, 0], "w": 1, "x": 0, "y": 3 },
{ "label": "2", "matrix": [3, 1], "w": 1, "x": 1, "y": 3 },
{ "label": "3", "matrix": [3, 2], "w": 1, "x": 2, "y": 3 },
{ "label": "0", "matrix": [4, 0], "w": 2, "x": 0, "y": 4 },
{ "label": ".", "matrix": [4, 2], "w": 1, "x": 2, "y": 4 },
{ "h": 2, "label": "Enter", "matrix": [3, 3], "w": 1, "x": 3, "y": 3 }
]
}
}

View File

@@ -0,0 +1 @@
Default keymap for the Clueboard 17.

View File

@@ -12,14 +12,4 @@ MCU = atmega32u4
BOOTLOADER = atmel-dfu
# Build Options
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
BACKLIGHT_DRIVER = custom
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
UNICODE_ENABLE = no # Unicode