From 47b9b110097a864d6ab76516b2213afd59948527 Mon Sep 17 00:00:00 2001 From: Zach White Date: Wed, 30 Dec 2020 10:27:37 -0800 Subject: 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 * add missing docstring Co-authored-by: Erovia --- keyboards/clueboard/card/card.h | 16 ----- keyboards/clueboard/card/config.h | 129 ------------------------------------- keyboards/clueboard/card/info.json | 62 +++++++++++++++--- keyboards/clueboard/card/rules.mk | 14 ---- 4 files changed, 52 insertions(+), 169 deletions(-) (limited to 'keyboards/clueboard/card') diff --git a/keyboards/clueboard/card/card.h b/keyboards/clueboard/card/card.h index a09285eb04..ef5b3f3e04 100644 --- a/keyboards/clueboard/card/card.h +++ b/keyboards/clueboard/card/card.h @@ -1,19 +1,3 @@ #pragma once #include "quantum.h" - -// This a shortcut to help you visually see your layout. -// The first section contains all of the arguements -// The second converts the arguments into a two-dimensional array -#define LAYOUT( \ - k00, k01, k02, \ - k10, k12, \ - k20, k21, k22, \ - k11, \ - k30, k31, k32 \ -) { \ - { k00, k01, k02, }, \ - { k10, k11, k12, }, \ - { k20, k21, k22, }, \ - { k30, k31, k32, } \ -} diff --git a/keyboards/clueboard/card/config.h b/keyboards/clueboard/card/config.h index b69ae640ed..67ddb5e25c 100644 --- a/keyboards/clueboard/card/config.h +++ b/keyboards/clueboard/card/config.h @@ -19,137 +19,8 @@ along with this program. If not, see . #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xC1ED -#define PRODUCT_ID 0x2330 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Clueboard -#define PRODUCT ATMEGA32U4 Firmware Dev Kit -#define DESCRIPTION A small board to help you hack on QMK. - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 3 - -/* Keyboard Matrix Assignments -*/ -#define MATRIX_ROW_PINS { F0, F5, F4, B4 } -#define MATRIX_COL_PINS { F1, F7, F6 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION ROW2COL - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCE 20 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - /* number of backlight levels */ #define BACKLIGHT_LEVELS 6 -/* 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 - -/* - * Force NKRO - * - * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved - * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the - * makefile for this to work.) - * - * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) - * until the next keyboard reset. - * - * NKRO may prevent your keystrokes from being detected in the BIOS, but it is - * fully operational during normal computer usage. - * - * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) - * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by - * bootmagic, NKRO mode will always be enabled until it is toggled again during a - * power-up. - * - */ -//#define FORCE_NKRO - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* Underlight configuration - */ -#define RGB_DI_PIN E6 -//#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 - -/* 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 - - // Enable audio #define C6_AUDIO diff --git a/keyboards/clueboard/card/info.json b/keyboards/clueboard/card/info.json index 8dfa035996..e46237175a 100644 --- a/keyboards/clueboard/card/info.json +++ b/keyboards/clueboard/card/info.json @@ -1,19 +1,61 @@ { + "manufacturer": "Clueboard", "keyboard_name": "Cluecard", - "keyboard_folder": "clueboard/card", - "url": "", "maintainer": "skullydazed", - "width": 10, "height": 8, + "width": 10, + "debounce": "20", + "diode_direction": "ROW2COL", + "features": { + "audio": true, + "backlight": true, + "bluetooth": false, + "bootmagic": false, + "command": true, + "console": true, + "extrakey": true, + "lto": true, + "midi": false, + "mousekey": true, + "nkro": false, + "rgblight": true, + "unicode": false + }, + "matrix_pins": { + "cols": ["F1", " F7", " F6"], + "rows": ["F0", " F5", " F4", " B4"] + }, + "rgblight": { + "brightness_steps": "17", + "hue_steps": "10", + "led_count": "4", + "pin": "E6", + "saturation_steps": "17" + }, + "usb": { + "device_ver": "0x0001", + "pid": "0x2330", + "vid": "0xC1ED" + }, + "layout_aliases": { + "LAYOUT": "LAYOUT_all" + }, "layouts": { - "LAYOUT": { + "LAYOUT_all": { + "key_count": 12, "layout": [ - {"label":"ON/OFF", "x":0, "y":0}, {"label":"SAT+", "x":4, "y":0}, {"label":"BRIGHT+", "x":8, "y":0}, - {"label":"HUE-", "x":2, "y":1}, {"label":"HUE+", "x":6, "y":1}, - {"label":"MODE", "x":0, "y":2}, {"label":"SAT-", "x":4, "y":2}, {"label":"BRIGHT-", "x":8, "y":2}, - {"label":"LAYER", "x":2, "y":4}, - - {"label":"MX1", "x":4, "y":6, "w":2, "h":2}, {"label":"MX2", "x":6, "y":6, "w":2, "h":2}, {"label":"MX3", "x":8, "y":6, "w":2, "h":2} + { "label": "ON/OFF", "matrix": [0, 0], "w": 1, "x": 0, "y": 0 }, + { "label": "SAT+", "matrix": [0, 1], "w": 1, "x": 4, "y": 0 }, + { "label": "BRIGHT+", "matrix": [0, 2], "w": 1, "x": 8, "y": 0 }, + { "label": "HUE-", "matrix": [1, 0], "w": 1, "x": 2, "y": 1 }, + { "label": "HUE+", "matrix": [1, 2], "w": 1, "x": 6, "y": 1 }, + { "label": "MODE", "matrix": [2, 0], "w": 1, "x": 0, "y": 2 }, + { "label": "SAT-", "matrix": [2, 1], "w": 1, "x": 4, "y": 2 }, + { "label": "BRIGHT-", "matrix": [2, 2], "w": 1, "x": 8, "y": 2 }, + { "label": "LAYER", "matrix": [1, 1], "w": 1, "x": 2, "y": 4 }, + { "h": 2, "label": "MX1", "matrix": [3, 0], "w": 2, "x": 4, "y": 6 }, + { "h": 2, "label": "MX2", "matrix": [3, 1], "w": 2, "x": 6, "y": 6 }, + { "h": 2, "label": "MX3", "matrix": [3, 2], "w": 2, "x": 8, "y": 6 } ] } } diff --git a/keyboards/clueboard/card/rules.mk b/keyboards/clueboard/card/rules.mk index a1b003f29c..75fb718e33 100644 --- a/keyboards/clueboard/card/rules.mk +++ b/keyboards/clueboard/card/rules.mk @@ -12,18 +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 = yes # Commands for debug and configuration -NKRO_ENABLE = no # USB Nkey Rollover -RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality BACKLIGHT_DRIVER = custom -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = yes # Audio output on port C6 - -LTO_ENABLE = yes -- cgit v1.2.1