From 2e90ef05363893f3aa49c99af408e774609aa97a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 10 Jun 2021 14:50:24 -0700 Subject: [Keyboard] Add Loop, Nano and Work boards from Work Louder (#12756) --- keyboards/work_louder/nano/config.h | 164 +++++++++++++++++++++ keyboards/work_louder/nano/info.json | 16 ++ .../work_louder/nano/keymaps/default/keymap.c | 37 +++++ .../work_louder/nano/keymaps/default/readme.md | 1 + keyboards/work_louder/nano/keymaps/via/keymap.c | 38 +++++ keyboards/work_louder/nano/keymaps/via/rules.mk | 2 + keyboards/work_louder/nano/nano.c | 42 ++++++ keyboards/work_louder/nano/nano.h | 42 ++++++ keyboards/work_louder/nano/post_config.h | 22 +++ keyboards/work_louder/nano/readme.md | 26 ++++ keyboards/work_louder/nano/rules.mk | 27 ++++ 11 files changed, 417 insertions(+) create mode 100644 keyboards/work_louder/nano/config.h create mode 100644 keyboards/work_louder/nano/info.json create mode 100644 keyboards/work_louder/nano/keymaps/default/keymap.c create mode 100644 keyboards/work_louder/nano/keymaps/default/readme.md create mode 100644 keyboards/work_louder/nano/keymaps/via/keymap.c create mode 100644 keyboards/work_louder/nano/keymaps/via/rules.mk create mode 100644 keyboards/work_louder/nano/nano.c create mode 100644 keyboards/work_louder/nano/nano.h create mode 100644 keyboards/work_louder/nano/post_config.h create mode 100644 keyboards/work_louder/nano/readme.md create mode 100644 keyboards/work_louder/nano/rules.mk (limited to 'keyboards/work_louder/nano') diff --git a/keyboards/work_louder/nano/config.h b/keyboards/work_louder/nano/config.h new file mode 100644 index 0000000000..4c897b7e51 --- /dev/null +++ b/keyboards/work_louder/nano/config.h @@ -0,0 +1,164 @@ +/* +Copyright 2021 Drashna Jael're + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x574C +#define PRODUCT_ID 0xE6EF +#define DEVICE_VER 0x0001 +#define MANUFACTURER Work Louder +#define PRODUCT nano + +/* key matrix size */ +#define MATRIX_ROWS 1 +#ifdef VIA_ENABLE +# define MATRIX_COLS 5 +#else +# define MATRIX_COLS 3 +#endif + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * + */ +#define MATRIX_ROW_PINS { F7 } +#define MATRIX_COL_PINS { B5, B6, C6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL */ +#define DIODE_DIRECTION COL2ROW + + +//#define LED_NUM_LOCK_PIN B0 +//#define LED_CAPS_LOCK_PIN B1 +//#define LED_SCROLL_LOCK_PIN B2 +//#define LED_COMPOSE_PIN B3 +//#define LED_KANA_PIN B4 + +//#define BACKLIGHT_PIN B7 +//#define BACKLIGHT_LEVELS 3 +//#define BACKLIGHT_BREATHING + +#define RGBLIGHT_DI_PIN C7 +# define RGBLED_NUM 6 +//# define RGBLIGHT_HUE_STEP 8 +//# define RGBLIGHT_SAT_STEP 8 +//# define RGBLIGHT_VAL_STEP 8 +//# define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +# define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ +# define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ +//# define RGBLIGHT_EFFECT_BREATHING +//# define RGBLIGHT_EFFECT_RAINBOW_MOOD +//# define RGBLIGHT_EFFECT_RAINBOW_SWIRL +//# define RGBLIGHT_EFFECT_SNAKE +//# define RGBLIGHT_EFFECT_KNIGHT +//# define RGBLIGHT_EFFECT_CHRISTMAS +//# define RGBLIGHT_EFFECT_STATIC_GRADIENT +//# define RGBLIGHT_EFFECT_RGB_TEST +//# define RGBLIGHT_EFFECT_ALTERNATING +/*== customize breathing effect ==*/ +/*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/ +//# define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64 +/*==== use exp() and sin() ====*/ +//# define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7 +//# define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255 +//#endif + +#define RGB_DI_PIN F6 +#define DRIVER_LED_TOTAL 2 +#define RGB_MATRIX_DISABLE_KEYCODES + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is useful for the Windows task manager shortcut (ctrl+shift+esc). + */ +//#define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * 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 + +/* disable these deprecated features by default */ +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +/* Bootmagic Lite key configuration */ +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 3 + + +#define ENCODERS_PAD_A { D7 } +#define ENCODERS_PAD_B { B4 } + +#define ENCODERS 1 + +#define ENCODERS_CW_KEY { { 3, 0 } } +#define ENCODERS_CCW_KEY { { 4, 0 } } diff --git a/keyboards/work_louder/nano/info.json b/keyboards/work_louder/nano/info.json new file mode 100644 index 0000000000..37d25531f4 --- /dev/null +++ b/keyboards/work_louder/nano/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "nano", + "url": "", + "maintainer": "Work Louder", + "width": 3, + "height": 1, + "layouts": { + "LAYOUT": { + "layout": [ + {"label": "k00", "x": 0, "y": 0}, + {"label": "k01", "x": 1, "y": 0}, + {"label": "k02", "x": 2, "y": 0}, + ] + } + } +} diff --git a/keyboards/work_louder/nano/keymaps/default/keymap.c b/keyboards/work_louder/nano/keymaps/default/keymap.c new file mode 100644 index 0000000000..e1b4bbcb98 --- /dev/null +++ b/keyboards/work_louder/nano/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2021 Drashna Jael're + * + * 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 . + */ +#include QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base */ + [0] = LAYOUT( + KC_PSCR, KC_LSFT, MO(1) + ), + [1] = LAYOUT( + RESET, KC_LCTL, _______ + ) +}; + + +// void encoder_update_user(uint8_t index, bool clockwise) { +// if (clockwise) { +// tap_code(KC_PGDN); +// } else { +// tap_code(KC_PGUP); +// } +// } diff --git a/keyboards/work_louder/nano/keymaps/default/readme.md b/keyboards/work_louder/nano/keymaps/default/readme.md new file mode 100644 index 0000000000..1ca552d721 --- /dev/null +++ b/keyboards/work_louder/nano/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for nano diff --git a/keyboards/work_louder/nano/keymaps/via/keymap.c b/keyboards/work_louder/nano/keymaps/via/keymap.c new file mode 100644 index 0000000000..84a54a4aac --- /dev/null +++ b/keyboards/work_louder/nano/keymaps/via/keymap.c @@ -0,0 +1,38 @@ +/* Copyright 2021 Drashna Jael're + * + * 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 . + */ +#include QMK_KEYBOARD_H + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base */ + [0] = LAYOUT_via( + KC_PSCR, MACRO00, MO(1), + KC_PGDN, KC_PGUP + ), + [1] = LAYOUT_via( + RESET, MACRO01, _______, + _______, _______ + ), + [2] = LAYOUT_via( + _______, _______, _______, + _______, _______ + ), + [3] = LAYOUT_via( + _______, _______, _______, + _______, _______ + ) +}; diff --git a/keyboards/work_louder/nano/keymaps/via/rules.mk b/keyboards/work_louder/nano/keymaps/via/rules.mk new file mode 100644 index 0000000000..36b7ba9cbc --- /dev/null +++ b/keyboards/work_louder/nano/keymaps/via/rules.mk @@ -0,0 +1,2 @@ +VIA_ENABLE = yes +LTO_ENABLE = yes diff --git a/keyboards/work_louder/nano/nano.c b/keyboards/work_louder/nano/nano.c new file mode 100644 index 0000000000..62d44ef133 --- /dev/null +++ b/keyboards/work_louder/nano/nano.c @@ -0,0 +1,42 @@ +/* Copyright 2021 Drashna Jael're + * + * 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 . + */ + +#include "nano.h" + +#if !defined(VIA_ENABLE) && defined(ENCODER_ENABLE) +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + return true; +} +#endif + +#ifdef RGB_MATRIX_ENABLE +led_config_t g_led_config = { + { + { NO_LED, 1, 0 } + }, { + { 103, 32 }, { 122, 32 } + }, { + 4, 4 + } +}; + +#endif diff --git a/keyboards/work_louder/nano/nano.h b/keyboards/work_louder/nano/nano.h new file mode 100644 index 0000000000..6f7463e6a4 --- /dev/null +++ b/keyboards/work_louder/nano/nano.h @@ -0,0 +1,42 @@ +/* Copyright 2021 Drashna Jael're + * + * 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 . + */ + +#pragma once + +#include "quantum.h" +#include "encoder_actions.h" +#include "rgb_functions.h" + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + k00, k01, k02 \ +) { \ + { k00, k01, k02 } \ +} + +#define LAYOUT_via( \ + k00, k01, k02, \ + k00_a, k00_b \ +) { \ + { k00, k01, k02, k00_a, k00_b } \ +} diff --git a/keyboards/work_louder/nano/post_config.h b/keyboards/work_louder/nano/post_config.h new file mode 100644 index 0000000000..263818bffe --- /dev/null +++ b/keyboards/work_louder/nano/post_config.h @@ -0,0 +1,22 @@ +/* +Copyright 2021 Drashna Jael're + +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 . +*/ + +#pragma once + +#ifndef TAP_CODE_DELAY +# define TAP_CODE_DELAY 10 +#endif diff --git a/keyboards/work_louder/nano/readme.md b/keyboards/work_louder/nano/readme.md new file mode 100644 index 0000000000..10bfcfd7e0 --- /dev/null +++ b/keyboards/work_louder/nano/readme.md @@ -0,0 +1,26 @@ +# Work Louder Nano pad + +![nano](https://worklouder.cc/wp-content/uploads/2021/02/LAST-1536x960.png) + +A 2 key macro pad with an encoder and RGB + +* Keyboard Maintainer: [Work Louder](https://github.com/drashna) +* Hardware Supported: An ATmega32u4 based macro pad with per key and underglow RGB +* Hardware Availability: [Work Louder](https://shop.worklouder.cc/) + + +Make example for this keyboard (after setting up your build environment): + + make work_louder/nano:default + +Flashing example for this keyboard: + + make work_louder/nano:default:flash + +Enter bootloader to flash the keyboard, you do either: + + * Hold down the right most key while plugging in the keyboard (furthest from encoder) + * Hold the third key down, and hit the encoder. + + +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). diff --git a/keyboards/work_louder/nano/rules.mk b/keyboards/work_louder/nano/rules.mk new file mode 100644 index 0000000000..fc478334b7 --- /dev/null +++ b/keyboards/work_louder/nano/rules.mk @@ -0,0 +1,27 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +ENCODER_ENABLE = yes +RGB_MATRIX_ENABLE = yes +RGB_MATRIX_DRIVER = WS2812 + +SRC += encoder_actions.c rgb_functions.c -- cgit v1.2.3