summaryrefslogtreecommitdiffstats
path: root/keyboards/staryu
diff options
context:
space:
mode:
authorKenneth Aloysius <krusli@users.noreply.github.com>2018-04-20 18:14:40 +0200
committerDrashna Jaelre <drashna@live.com>2018-04-20 18:14:40 +0200
commit0912c42f04e7c96c80cc9f48c258082e5ba31e2d (patch)
treee2ec9ea8ed934c8e3aa4b4efe4fcdb0b53a57a84 /keyboards/staryu
parent3ea8bcb8ae768f43218a5d1e0934867059259f92 (diff)
downloadqmk_firmware-0912c42f04e7c96c80cc9f48c258082e5ba31e2d.tar.gz
qmk_firmware-0912c42f04e7c96c80cc9f48c258082e5ba31e2d.tar.xz
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
Diffstat (limited to 'keyboards/staryu')
-rw-r--r--keyboards/staryu/backlight_staryu.c52
-rw-r--r--keyboards/staryu/backlight_staryu.h12
-rwxr-xr-xkeyboards/staryu/config.h74
-rw-r--r--keyboards/staryu/keymaps/default/README.md3
-rwxr-xr-xkeyboards/staryu/keymaps/default/keymap.c82
-rw-r--r--keyboards/staryu/keymaps/default/rules.mk1
-rw-r--r--keyboards/staryu/keymaps/krusli/README.md9
-rw-r--r--keyboards/staryu/keymaps/krusli/keymap.c97
-rw-r--r--keyboards/staryu/readme.md15
-rwxr-xr-xkeyboards/staryu/rules.mk60
-rwxr-xr-xkeyboards/staryu/staryu.c26
-rwxr-xr-xkeyboards/staryu/staryu.h28
12 files changed, 459 insertions, 0 deletions
diff --git a/keyboards/staryu/backlight_staryu.c b/keyboards/staryu/backlight_staryu.c
new file mode 100644
index 000000000..6fb9713f3
--- /dev/null
+++ b/keyboards/staryu/backlight_staryu.c
@@ -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;
+ }
+}
diff --git a/keyboards/staryu/backlight_staryu.h b/keyboards/staryu/backlight_staryu.h
new file mode 100644
index 000000000..f718b970c
--- /dev/null
+++ b/keyboards/staryu/backlight_staryu.h
@@ -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
diff --git a/keyboards/staryu/config.h b/keyboards/staryu/config.h
new file mode 100755
index 000000000..268fe991a
--- /dev/null
+++ b/keyboards/staryu/config.h
@@ -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
diff --git a/keyboards/staryu/keymaps/default/README.md b/keyboards/staryu/keymaps/default/README.md
new file mode 100644
index 000000000..836d3ab4d
--- /dev/null
+++ b/keyboards/staryu/keymaps/default/README.md
@@ -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).
diff --git a/keyboards/staryu/keymaps/default/keymap.c b/keyboards/staryu/keymaps/default/keymap.c
new file mode 100755
index 000000000..3dc480299
--- /dev/null
+++ b/keyboards/staryu/keymaps/default/keymap.c
@@ -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) {
+}
diff --git a/keyboards/staryu/keymaps/default/rules.mk b/keyboards/staryu/keymaps/default/rules.mk
new file mode 100644
index 000000000..6c605daec
--- /dev/null
+++ b/keyboards/staryu/keymaps/default/rules.mk
@@ -0,0 +1 @@
+MOUSEKEY_ENABLE = yes
diff --git a/keyboards/staryu/keymaps/krusli/README.md b/keyboards/staryu/keymaps/krusli/README.md
new file mode 100644
index 000000000..66a097907
--- /dev/null
+++ b/keyboards/staryu/keymaps/krusli/README.md
@@ -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
diff --git a/keyboards/staryu/keymaps/krusli/keymap.c b/keyboards/staryu/keymaps/krusli/keymap.c
new file mode 100644
index 000000000..2879b68e5
--- /dev/null
+++ b/keyboards/staryu/keymaps/krusli/keymap.c
@@ -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) {
+}
diff --git a/keyboards/staryu/readme.md b/keyboards/staryu/readme.md
new file mode 100644
index 000000000..bca7482bc
--- /dev/null
+++ b/keyboards/staryu/readme.md
@@ -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.
diff --git a/keyboards/staryu/rules.mk b/keyboards/staryu/rules.mk
new file mode 100755
index 000000000..3e043bbcd
--- /dev/null
+++ b/keyboards/staryu/rules.mk
@@ -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
diff --git a/keyboards/staryu/staryu.c b/keyboards/staryu/staryu.c
new file mode 100755
index 000000000..6dcaaea0e
--- /dev/null
+++ b/keyboards/staryu/staryu.c
@@ -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();
+}
diff --git a/keyboards/staryu/staryu.h b/keyboards/staryu/staryu.h
new file mode 100755
index 000000000..12b8be92e
--- /dev/null
+++ b/keyboards/staryu/staryu.h
@@ -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