diff options
author | hornslyn <86503162+hornslyn@users.noreply.github.com> | 2022-07-26 13:24:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 22:24:04 -0700 |
commit | a33dc8ebb5fbe4445e59342355baaa0b75124ae4 (patch) | |
tree | 0007829d66baae4672ae75852183b6d0b82dec3b | |
parent | 753ca0e13c5ad97c47fcd6e92678b207882cfdd0 (diff) |
[Keyboard] Add Star75 support (#17421)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r-- | keyboards/star75/config.h | 65 | ||||
-rw-r--r-- | keyboards/star75/info.json | 10 | ||||
-rw-r--r-- | keyboards/star75/keymaps/default/keymap.c | 103 | ||||
-rw-r--r-- | keyboards/star75/keymaps/default/readme.md | 16 | ||||
-rw-r--r-- | keyboards/star75/keymaps/via/keymap.c | 102 | ||||
-rw-r--r-- | keyboards/star75/keymaps/via/rules.mk | 4 | ||||
-rw-r--r-- | keyboards/star75/readme.md | 28 | ||||
-rw-r--r-- | keyboards/star75/rules.mk | 23 | ||||
-rw-r--r-- | keyboards/star75/star75.c | 4 | ||||
-rw-r--r-- | keyboards/star75/star75.h | 25 |
10 files changed, 380 insertions, 0 deletions
diff --git a/keyboards/star75/config.h b/keyboards/star75/config.h new file mode 100644 index 0000000000..e4d5ec2c89 --- /dev/null +++ b/keyboards/star75/config.h @@ -0,0 +1,65 @@ +/* +Copyright 2022 Horns Lyn (@hornslyn) +SPDX-License-Identifier: GPL-2.0-or-later */ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4B35 +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER DXWS +#define PRODUCT Star75 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B7, D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { D4, D6, D7, B4, B5, B6, C6, C7, F7, F6, F5, F4, F1, F0, E6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* encoder definitions */ +#ifdef ENCODER_ENABLE +#define ENCODERS_PAD_A { B2 } +#define ENCODERS_PAD_B { B1 } +#endif + +/* 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 + +#define RGB_DI_PIN B3 + +#ifdef RGB_DI_PIN +#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 +#define RGBLIGHT_EFFECT_TWINKLE +#define RGBLED_NUM 1 +#define RGBLIGHT_LAYERS +#define RGBLIGHT_LED_MAP { 0, 1 } +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_LIMIT_VAL 180 +#define RGBLIGHT_LAYERS_OVERRIDE_RGB_OFF +#endif diff --git a/keyboards/star75/info.json b/keyboards/star75/info.json new file mode 100644 index 0000000000..ccf8646431 --- /dev/null +++ b/keyboards/star75/info.json @@ -0,0 +1,10 @@ +{ + "keyboard_name": "Star75", + "url": "https://item.taobao.com/item.htm?id=656392112467", + "maintainer": "qmk", + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1.5, "y":0}, {"label":"F2", "x":2.5, "y":0}, {"label":"F3", "x":3.5, "y":0}, {"label":"F4", "x":4.5, "y":0}, {"label":"F5", "x":6, "y":0}, {"label":"F6", "x":7, "y":0}, {"label":"F7", "x":8, "y":0}, {"label":"F8", "x":9, "y":0}, {"label":"F9", "x":10.5, "y":0}, {"label":"F10", "x":11.5, "y":0}, {"label":"F11", "x":12.5, "y":0}, {"label":"F12", "x":13.5, "y":0}, {"label":"Ins", "x":15, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Home", "x":15, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"PgUp", "x":15, "y":2.25}, {"label":"Capslock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":"", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"PgDn", "x":15, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, {"label":"Up", "x":14, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"label":"Fn", "x":10, "y":5.25, "w":1.25}, {"label":"Alt", "x":11.25, "y":5.25, "w":1.25}, {"label":"Left", "x":13, "y":5.25}, {"label":"Down", "x":14, "y":5.25}, {"label":"Right", "x":15, "y":5.25}] + } + } +} diff --git a/keyboards/star75/keymaps/default/keymap.c b/keyboards/star75/keymaps/default/keymap.c new file mode 100644 index 0000000000..996615877d --- /dev/null +++ b/keyboards/star75/keymaps/default/keymap.c @@ -0,0 +1,103 @@ +/* +Copyright 2022 Horns Lyn (@hornslyn) +SPDX-License-Identifier: GPL-2.0-or-later */ +#include QMK_KEYBOARD_H + +enum layer_names { + _HOME = 0, + _FN1, + _FN2, + _FN3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_HOME] = LAYOUT_all( + KC_ESC, 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_GRV, 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_BSPC, KC_HOME, + 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_BSLS, KC_PGUP, + KC_CAPS, 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_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_RMOD, KC_TRNS), + + [_FN2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +/* capslock/layer indicators; using rgb led; start */ +// capslock; +const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_RED} +); +// layer 1; +const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_CYAN} +); +// layer 2; +const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_PURPLE} +); +// layer 3; +const rgblight_segment_t PROGMEM my_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_GREEN} +); + +// Now define the array of layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + my_capslock_layer, + my_layer1_layer, // Overrides caps lock layer + my_layer2_layer, // Overrides other layers + my_layer3_layer // Overrides other layers +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} + +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(0, led_state.caps_lock); + return true; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(_FN1, layer_state_cmp(state, _FN1)); + rgblight_set_layer_state(_FN2, layer_state_cmp(state, _FN2)); + rgblight_set_layer_state(_FN3, layer_state_cmp(state, _FN3)); + return state; +} +/* capslock/layer indicators; using rgb led; end */ + +/* encoder; start */ +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_HOME] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_FN1] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) }, + [_FN2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } + +}; +#endif +/* encoder; end */ + diff --git a/keyboards/star75/keymaps/default/readme.md b/keyboards/star75/keymaps/default/readme.md new file mode 100644 index 0000000000..d1b7656403 --- /dev/null +++ b/keyboards/star75/keymaps/default/readme.md @@ -0,0 +1,16 @@ +# Default Star75 Layout + +This is the default layout of Star75 PCB. + +Note that the optional encoder is disabled by default. + +rules.mk OPTIONS + +`ENCODER_MAP_ENABLE = yes` - turns on the optional encoder + +## Layer diagrams +Default layer +![Star75 Default Layout](https://i.imgur.com/AYbSn4O.png) + +Fn layer +![Star75 Fn Layout](https://i.imgur.com/51IbsCP.png) diff --git a/keyboards/star75/keymaps/via/keymap.c b/keyboards/star75/keymaps/via/keymap.c new file mode 100644 index 0000000000..43b53d80dd --- /dev/null +++ b/keyboards/star75/keymaps/via/keymap.c @@ -0,0 +1,102 @@ +/* +Copyright 2022 Horns Lyn (@hornslyn) +SPDX-License-Identifier: GPL-2.0-or-later */ +#include QMK_KEYBOARD_H + +enum layer_names { + _HOME = 0, + _FN1, + _FN2, + _FN3 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_HOME] = LAYOUT_all( + KC_ESC, 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_GRV, 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_BSPC, KC_HOME, + 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_BSLS, KC_PGUP, + KC_CAPS, 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_PGDN, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), + + [_FN1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_RMOD, KC_TRNS), + + [_FN2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +/* capslock/layer indicators; using rgb led; start */ +// capslock; +const rgblight_segment_t PROGMEM my_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_RED} +); +// layer 1; +const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_CYAN} +); +// layer 2; +const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_PURPLE} +); +// layer 3; +const rgblight_segment_t PROGMEM my_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS( + {0, 1, HSV_GREEN} +); + +// Now define the array of layers. Later layers take precedence +const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST( + my_capslock_layer, + my_layer1_layer, // Overrides caps lock layer + my_layer2_layer, // Overrides other layers + my_layer3_layer // Overrides other layers +); + +void keyboard_post_init_user(void) { + // Enable the LED layers + rgblight_layers = my_rgb_layers; +} + +bool led_update_user(led_t led_state) { + rgblight_set_layer_state(0, led_state.caps_lock); + return true; +} + +layer_state_t layer_state_set_user(layer_state_t state) { + rgblight_set_layer_state(_FN1, layer_state_cmp(state, _FN1)); + rgblight_set_layer_state(_FN2, layer_state_cmp(state, _FN2)); + rgblight_set_layer_state(_FN3, layer_state_cmp(state, _FN3)); + return state; +} +/* capslock/layer indicators; using rgb led; end */ + +/* encoder; start */ +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_HOME] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_FN1] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) }, + [_FN2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) }, + [_FN3] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } +}; +#endif +/* encoder; end */ + diff --git a/keyboards/star75/keymaps/via/rules.mk b/keyboards/star75/keymaps/via/rules.mk new file mode 100644 index 0000000000..f48a8b1056 --- /dev/null +++ b/keyboards/star75/keymaps/via/rules.mk @@ -0,0 +1,4 @@ +ENCODER_MAP_ENABLE = yes +VIA_ENABLE = yes +LTO_ENABLE = yes + diff --git a/keyboards/star75/readme.md b/keyboards/star75/readme.md new file mode 100644 index 0000000000..6d7b9b0577 --- /dev/null +++ b/keyboards/star75/readme.md @@ -0,0 +1,28 @@ +# 大星外设 DXWS Star75 + +75% Hotswap PCB with optional rotary encoder. + +![View of Star75 Keyboard](https://i.imgur.com/UrvnjiZ.jpeg) +![Star75 Default Layout](https://i.imgur.com/LkTP0Cj.png) + +* Keyboard Maintainer: QMK Community +* Hardware Supported: Star75 1.2mm Flex-cut Hotswap PCB +* Hardware Availability: [大星外设](https://item.taobao.com/item.htm?id=656392112467) + +Make example for this keyboard (after setting up your build environment): + + make star75:default + +Flashing example for this keyboard: + + make star75:default:flash + +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). + +## Bootloader + +Enter the bootloader in 2 ways: + +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard +* **Keycode in layout**: Press the key mapped to `RESET` if it is available + diff --git a/keyboards/star75/rules.mk b/keyboards/star75/rules.mk new file mode 100644 index 0000000000..0b3ffc06f2 --- /dev/null +++ b/keyboards/star75/rules.mk @@ -0,0 +1,23 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +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 +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output + +ENCODER_ENABLE = yes +LTO_ENABLE = yes + + diff --git a/keyboards/star75/star75.c b/keyboards/star75/star75.c new file mode 100644 index 0000000000..abadba8625 --- /dev/null +++ b/keyboards/star75/star75.c @@ -0,0 +1,4 @@ +/* +Copyright 2022 Horns Lyn (@hornslyn) +SPDX-License-Identifier: GPL-2.0-or-later */ +#include "star75.h" diff --git a/keyboards/star75/star75.h b/keyboards/star75/star75.h new file mode 100644 index 0000000000..7e47ea0e40 --- /dev/null +++ b/keyboards/star75/star75.h @@ -0,0 +1,25 @@ +/* +Copyright 2022 Horns Lyn (@hornslyn) +SPDX-License-Identifier: GPL-2.0-or-later */ +#pragma once + +#include "quantum.h" + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3E, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4C, K4D, \ + K50, K51, K52, K55, K59, K5A, K5C, K5D, K5E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, KC_NO, K4C, K4D, KC_NO }, \ + { K50, K51, K52, KC_NO, KC_NO, K55, KC_NO, KC_NO, KC_NO, K59, K5A, KC_NO, K5C, K5D, K5E } \ +} + + + |