1
0
Fork 0

Add Staryu macropad support (#2768)

* Add M6-A keymap

* Update XD60 keymap

* Update XD60 keymap readme

* Update JJ40 and Let's Split keymaps

* Add readme for M6-A

* Fix typo, update JJ40 README

* Update jj40 readme

* Cleanup jj40 keymap

* Revert Let's Split QWERTY layer to default before #2010

* Update numpad layers

* Fix: Let's Split keymap getting stuck mods due to having keycodes assigned on the Raise layer

* Keep ASCII art consistent with keymap

* Staryu: initial port

* Add personal keymap

* Added and updated READMEs

* Fix: default keymap for staryu

* Rudimentary backlight support.

* Enabled mousekeys for default keymap

* use QMK_KEYBOARD_H and LAYOUT

* Update readme.md for NIU mini: flash using avrdude

* Fix missing linebreaks for Staryu README

* Update readme.md
This commit is contained in:
Kenneth Aloysius 2018-04-21 02:14:40 +10:00 committed by Drashna Jaelre
parent 3ea8bcb8ae
commit 0912c42f04
16 changed files with 546 additions and 9 deletions

View file

@ -0,0 +1 @@
#define USB_MAX_POWER_CONSUMPTION 100

View file

@ -0,0 +1,78 @@
/* -*- eval: (turn-on-orgtbl); -*-
* default HHKB Layout
*/
#include "hhkb.h"
#define BASE 0
#define HHKB 1
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* BASE Level: Default Layer
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Backs | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Cont | A | S | D | F | G | H | J | K | L | ; | ' | Ent | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Fn0 | | |
|-------+---+---+---+---+---+---+---+---+---+---+-------+-----+-------+---|
|------+------+-----------------------+------+------|
| LAlt | LGUI | ******* Space ******* | RGUI | RAlt |
|------+------+-----------------------+------+------|
*/
[BASE] = KEYMAP( // default layer
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(HHKB), \
KC_LALT, KC_LGUI, /* */ KC_SPC, KC_RGUI, KC_RALT),
/* Layer HHKB: HHKB mode (HHKB Fn)
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| Pwr | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| Caps | | | | | | | | Psc | Slk | Pus | Up | | Backs | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| | VoD | VoU | Mut | | | * | / | Hom | PgU | Lef | Rig | Enter | | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
| | | | | | | + | - | End | PgD | Dow | | | | |
|------+-----+-----+-----+----+----+----+----+-----+-----+-----+-----+-------+-------+-----|
|------+------+----------------------+------+------+
| **** | **** | ******************** | **** | **** |
|------+------+----------------------+------+------+
*/
[HHKB] = KEYMAP(
KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \
KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)};
const uint16_t PROGMEM fn_actions[] = {
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
// MACRODOWN only works in this function
switch(id) {
case 0:
if (record->event.pressed) {
register_code(KC_RSFT);
} else {
unregister_code(KC_RSFT);
}
break;
}
return MACRO_NONE;
};

View file

@ -31,21 +31,20 @@ enum custom_keycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
* | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Tab | A | S | D | F | G | H | J | K | L | ; | " |
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Adjust| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT( \
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
[_QWERTY] = KEYMAP(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
KC_LCTRL,KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Colemak

View file

@ -11,6 +11,6 @@ Hardware Availability: [KBDFans](https://kbdfans.myshopify.com/products/niu-mini
Make example for this keyboard (after setting up your build environment):
make niu_mini:default
make niu_mini:default:avrdude
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.

View file

@ -0,0 +1,52 @@
#include "backlight.h"
#include <avr/pgmspace.h>
/* backlighting */
void init_backlight_led(void)
{
DDRC |= (1<<PC2 | 1<<PC7);
DDRD |= (1<<PD5 | 1<<PD6);
DDRB |= (1<<PB0);
}
void backlight_led_off(uint8_t index)
{
switch (index) {
case 0:
PORTC |= (1<<PC2);
break;
case 1:
PORTC |= (1<<PC7);
break;
case 2:
PORTD |= (1<<PD5);
break;
case 3:
PORTD |= (1<<PD6);
break;
case 4:
PORTB |= (1<<PB0);
break;
}
}
void backlight_led_on(uint8_t index)
{
switch (index) {
case 0:
PORTC &= ~(1<<PC2);
break;
case 1:
PORTC &= ~(1<<PC7);
break;
case 2:
PORTD &= ~(1<<PD5);
break;
case 3:
PORTD &= ~(1<<PD6);
break;
case 4:
PORTB &= ~(1<<PB0);
break;
}
}

View file

@ -0,0 +1,12 @@
#ifndef STARYU_BL
#define STARYU_BL
#include <stdint.h>
void init_backlight_led(void);
void backlight_led_on(uint8_t index);
void backlight_led_off(uint8_t index);
#endif

74
keyboards/staryu/config.h Executable file
View file

@ -0,0 +1,74 @@
/*
Copyright 2018 Cole Markham
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/>.
*/
#ifndef CONFIG_H
#define CONFIG_H
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x1209
#define PRODUCT_ID 0x2328
#define DEVICE_VER 0x0205
#define MANUFACTURER K.T.E.C.
#define PRODUCT Staryu
#define DESCRIPTION 5-key macropad
/* key matrix size */
#define MATRIX_ROWS 1
#define MATRIX_COLS 5
/* key matrix pins */
#define MATRIX_ROW_PINS { }
#define MATRIX_COL_PINS { D0, D1, D2, D3, D4 }
#define UNUSED_PINS
// from light_ws2812_config @
// https://github.com/kairyu/tmk_keyboard_custom/tree/master/keyboard/staryu
#define RGB_DI_PIN C6
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 1 // Number of LEDs
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
/* Set 0 if debouncing isn't needed */
#define DEBOUNCING_DELAY 5
// TODO backlighting
#define BACKLIGHT_LEVELS 10
// #define BACKLIGHT_PIN B7
/*
Backlight: C2, C7, D5, D6, B0
switch (index) {
case 0:
PORTC &= ~(1<<PC2);
break;
case 1:
PORTC &= ~(1<<PC7);
break;
case 2:
PORTD &= ~(1<<PD5);
break;
case 3:
PORTD &= ~(1<<PD6);
break;
case 4:
PORTB &= ~(1<<PB0);
break;
*/
#endif

View file

@ -0,0 +1,3 @@
# Default keymap
Default keymap for the Staryu macropad, adapted from [kairyu's repo](https://github.com/kairyu/tmk_keyboard_custom/blob/master/keyboard/staryu/keymap_default.c).

View file

@ -0,0 +1,82 @@
/*
Copyright 2018 Kenneth Aloysius
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/>.
*/
#include QMK_KEYBOARD_H
#include "action_layer.h"
enum layers {
_LAYER0,
_LAYER1,
_LAYER2,
_LAYER3
};
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* Keymap 0
* ,-----------.
* | |Up |Fn0|
* |---+---+---|
* |Lef|Dow|Rig|
* `-----------'
*/
LAYOUT( KC_UP, TO(_LAYER1), KC_LEFT,KC_DOWN,KC_RIGHT ),
/* Keymap 1
* ,-----------.
* | |PgU|Fn1|
* |---+---+---|
* |Hom|PgD|End|
* `-----------'
*/
LAYOUT( KC_PGUP,TO(_LAYER2), KC_HOME,KC_PGDN,KC_END ),
/* Keymap 2
* ,-----------.
* | |Sel|Fn2|
* |---+---+---|
* |Pre|Pla|Nex|
* `-----------'
*/
LAYOUT( KC_MSEL,TO(_LAYER3), KC_MPRV,KC_MPLY,KC_MNXT ),
/* Keymap 3
* ,-----------.
* | |MsU|Fn3|
* |---+---+---|
* |MsL|MsD|MsR|
* `-----------'
*/
LAYOUT( KC_MS_U,TO(_LAYER0), KC_MS_L,KC_MS_D,KC_MS_R ),
// /* Keymap 4
// * ,-----------.
// * | |Fn6|Fn4|
// * |---+---+---|
// * |Fn7|Fn5|Fn8|
// * `-----------'
// */
// LAYOUT( FN6, FN4, FN7, FN5, FN8 ),
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
return MACRO_NONE ;
}
void matrix_init_user(void) {
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

View file

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

View file

@ -0,0 +1,9 @@
# krusli's RAMA M6-A Layout
Personal keymap for the RAMA M6-A.
Top-right button acts as a "toggle between layers" button. Layer 0 -> Layer 1 -> Layer 2 -> Layer 0 -> ...
- Layer 0: Osu! gamepad layer
- Layer 1: Git commands
- Layer 2 and 3: RGB controls

View file

@ -0,0 +1,97 @@
/*
Copyright 2018 Kenneth Aloysius
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/>.
*/
#include QMK_KEYBOARD_H
#include "action_layer.h"
#include "../../backlight_staryu.h"
enum layers {
_LAYER0,
_LAYER1,
_LAYER2,
_LAYER3
};
enum custom_keycodes {
GIT_ADD = SAFE_RANGE,
GIT_COMMIT,
GIT_PUSH,
MUTE,
DEAFEN
};
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
switch(keycode) {
case GIT_ADD:
SEND_STRING("git add ."SS_TAP(X_ENTER));
break;
case GIT_COMMIT:
SEND_STRING("git commit -m "SS_DOWN(X_LSHIFT)SS_TAP(X_QUOTE)SS_UP(X_LSHIFT));
break;
case GIT_PUSH:
SEND_STRING("git push"SS_TAP(X_ENTER));
break;
case MUTE:
SEND_STRING(SS_LGUI(SS_LSFT("M")));
break;
case DEAFEN:
SEND_STRING(SS_LGUI(SS_LSFT("D")));
break;
return false;
}
}
return true;
};
#define _______ KC_TRNS
#define XXXXXXX KC_NO
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_LAYER0] = LAYOUT( \
KC_ESC, TO(_LAYER1), \
KC_Z, KC_X, KC_SPACE \
),
[_LAYER1] = LAYOUT( \
MUTE, TO(_LAYER2), \
GIT_ADD, GIT_COMMIT, GIT_PUSH \
),
[_LAYER2] = LAYOUT( \
RGB_MOD, TO(_LAYER3), \
RGB_TOG, RGB_HUD, RGB_HUI \
),
[_LAYER3] = LAYOUT( \
RGB_VAI, TO(_LAYER0), \
RGB_SAD, RGB_VAD, RGB_SAI \
)
};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
return MACRO_NONE ;
}
void matrix_init_user(void) {
for (int i=0; i<5; i++) {
backlight_led_on(i);
}
}
void matrix_scan_user(void) {
}
void led_set_user(uint8_t usb_led) {
}

View file

@ -0,0 +1,15 @@
# Staryu
![Staryu](https://i.imgur.com/obcCpZN.jpg)
A 5 key macropad, designed by Kai and sold by KPRepublic.
Keyboard Maintainer: QMK Community
Hardware Supported: Staryu (only the non-lite version has been tested)
Hardware Availability: [AliExpress](https://www.aliexpress.com/item/Staryu-Mini-Macro-Pad-custom-keyboard-by-tkg-kai-Mini-macro-pad-mechanical-keyboard-5-keys/32817560746.html)
Make example for this keyboard (after setting up your build environment):
make staryu:default
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.

60
keyboards/staryu/rules.mk Executable file
View file

@ -0,0 +1,60 @@
# MCU name
MCU = atmega32u2
BOOTLOADER = lufa-dfu
SRC = backlight_staryu.c
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = yes # In-switch LEDs
AUDIO_ENABLE = no # There is no available timer or pin for audio on the NovelPad
RGBLIGHT_ENABLE = yes # RGB LEDs for underglow, installed and enabled by default for the NovelPad

26
keyboards/staryu/staryu.c Executable file
View file

@ -0,0 +1,26 @@
/*
Copyright 2018 Cole Markham
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/>.
*/
#include "staryu.h"
#include "backlight_staryu.h"
// for keyboard subdirectory level init functions
// @Override
void matrix_init_kb(void) {
// call user level keymaps, if any
init_backlight_led();
matrix_init_user();
}

28
keyboards/staryu/staryu.h Executable file
View file

@ -0,0 +1,28 @@
/*
Copyright 2018 Cole Markham
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/>.
*/
#ifndef KB_H
#define KB_H
#include "quantum.h"
#define LAYOUT( \
K00, K01, \
K10, K11, K12 \
) { \
{ K00, K01, K12, K11, K10 }, \
}
#endif