diff options
author | Gregorio <38576492+ohchiko@users.noreply.github.com> | 2020-06-18 11:39:16 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 21:39:16 -0700 |
commit | 30fd69886dcf069a4e0d2c02ce18803500fcad2e (patch) | |
tree | 932c28985b43d8ea7c3a0f8224a8a217feb97dfb | |
parent | ed528403fd768e804887b957891b7a16319ae4dc (diff) | |
download | qmk_firmware-30fd69886dcf069a4e0d2c02ce18803500fcad2e.tar.gz qmk_firmware-30fd69886dcf069a4e0d2c02ce18803500fcad2e.zip |
[Keyboard] Add Mixi (#9364)
* [Keyboard] Add Mixi
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r-- | keyboards/mixi/config.h | 47 | ||||
-rw-r--r-- | keyboards/mixi/info.json | 22 | ||||
-rw-r--r-- | keyboards/mixi/keymaps/default/keymap.c | 116 | ||||
-rw-r--r-- | keyboards/mixi/keymaps/default/readme.md | 10 | ||||
-rw-r--r-- | keyboards/mixi/keymaps/via/keymap.c | 116 | ||||
-rw-r--r-- | keyboards/mixi/keymaps/via/rules.mk | 2 | ||||
-rw-r--r-- | keyboards/mixi/mixi.c | 13 | ||||
-rw-r--r-- | keyboards/mixi/mixi.h | 13 | ||||
-rw-r--r-- | keyboards/mixi/readme.md | 15 | ||||
-rw-r--r-- | keyboards/mixi/rules.mk | 27 |
10 files changed, 381 insertions, 0 deletions
diff --git a/keyboards/mixi/config.h b/keyboards/mixi/config.h new file mode 100644 index 000000000..cb89dd2cb --- /dev/null +++ b/keyboards/mixi/config.h | |||
@@ -0,0 +1,47 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "config_common.h" | ||
4 | |||
5 | /* USB Device descriptor parameter */ | ||
6 | #define VENDOR_ID 0x4752 | ||
7 | #define PRODUCT_ID 0x4D49 | ||
8 | #define DEVICE_VER 0x0001 | ||
9 | #define MANUFACTURER gregorio | ||
10 | #define PRODUCT Mixi | ||
11 | #define DESCRIPTION Mixi macropad by gregorio | ||
12 | |||
13 | /* key matrix size */ | ||
14 | #define MATRIX_ROWS 3 | ||
15 | #define MATRIX_COLS 3 | ||
16 | |||
17 | /* Keyboard Matrix Assignments */ | ||
18 | #define DIRECT_PINS { \ | ||
19 | { D1, D4, F4 }, \ | ||
20 | { D0, B4, F5 }, \ | ||
21 | { C6, F7, B6 } \ | ||
22 | } | ||
23 | |||
24 | #define ENCODERS_PAD_A { F5 } | ||
25 | #define ENCODERS_PAD_B { F4 } | ||
26 | |||
27 | /* Set 0 if debouncing isn't needed */ | ||
28 | #define DEBOUNCE 5 | ||
29 | |||
30 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
31 | #define LOCKING_SUPPORT_ENABLE | ||
32 | |||
33 | /* Locking resynchronize hack */ | ||
34 | #define LOCKING_RESYNC_ENABLE | ||
35 | |||
36 | #define RGB_DI_PIN B5 | ||
37 | #ifdef RGB_DI_PIN | ||
38 | #define RGBLED_NUM 5 | ||
39 | #define RGBLIGHT_HUE_STEP 8 | ||
40 | #define RGBLIGHT_SAT_STEP 8 | ||
41 | #define RGBLIGHT_VAL_STEP 8 | ||
42 | #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ | ||
43 | #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ | ||
44 | #define RGBLIGHT_ANIMATIONS | ||
45 | #define RGBLIGHT_LAYERS | ||
46 | #define RGBLIGHT_LAYER_BLINK | ||
47 | #endif | ||
diff --git a/keyboards/mixi/info.json b/keyboards/mixi/info.json new file mode 100644 index 000000000..123e23dc6 --- /dev/null +++ b/keyboards/mixi/info.json | |||
@@ -0,0 +1,22 @@ | |||
1 | { | ||
2 | "keyboard_name": "Mixi", | ||
3 | "url": "https://tokopedia.com/sell-stuffs", | ||
4 | "maintainer": "ohchiko", | ||
5 | "width": 3, | ||
6 | "height": 3, | ||
7 | "layouts": { | ||
8 | "LAYOUT": { | ||
9 | "layout": [ | ||
10 | {"x":0, "y":0}, | ||
11 | {"x":1, "y":0}, | ||
12 | {"x":2, "y":0}, | ||
13 | {"x":0, "y":1}, | ||
14 | {"x":1, "y":1}, | ||
15 | {"x":2, "y":1}, | ||
16 | {"x":0, "y":2}, | ||
17 | {"x":1, "y":2}, | ||
18 | {"x":2, "y":2} | ||
19 | ] | ||
20 | } | ||
21 | } | ||
22 | } | ||
diff --git a/keyboards/mixi/keymaps/default/keymap.c b/keyboards/mixi/keymaps/default/keymap.c new file mode 100644 index 000000000..806a7a924 --- /dev/null +++ b/keyboards/mixi/keymaps/default/keymap.c | |||
@@ -0,0 +1,116 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | // please change this value to the desired layer definitions | ||
4 | #define LAYERNUM 3 | ||
5 | |||
6 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
7 | |||
8 | /* | ||
9 | * | Knob: Layer +/- | | ||
10 | * .---------------------------------------. | ||
11 | * | Mute | Play/Pause | Hold: Layer 2 | | ||
12 | * |----------|------------|---------------| | ||
13 | * | Previous | Up | Next | | ||
14 | * |----------|------------|---------------| | ||
15 | * | Left | Down | Right | | ||
16 | * '---------------------------------------' | ||
17 | */ | ||
18 | [0] = | ||
19 | LAYOUT( | ||
20 | KC_MUTE, KC_MPLY, MO(2), | ||
21 | KC_MNXT, KC_UP , KC_MPRV , | ||
22 | KC_LEFT, KC_DOWN , KC_RGHT | ||
23 | ), | ||
24 | |||
25 | /* | ||
26 | * .-----------------------. | ||
27 | * | NUM 7 | NUM 8 | NUM 9 | | ||
28 | * |-------|-------|-------| | ||
29 | * | NUM 4 | NUM 5 | NUM 6 | | ||
30 | * |-------|-------|-------| | ||
31 | * | NUM 1 | NUM 2 | NUM 3 | | ||
32 | * '-----------------------' | ||
33 | */ | ||
34 | [1] = | ||
35 | LAYOUT( | ||
36 | KC_P7, KC_P8, KC_P8, | ||
37 | KC_P4, KC_P5, KC_P6, | ||
38 | KC_P1, KC_P2, KC_P3 | ||
39 | ), | ||
40 | |||
41 | /* | ||
42 | * | Knob: Volume +/- | | ||
43 | * .--------------------------------------. | ||
44 | * | N/A | N/A | Hold: Layer 2 | | ||
45 | * |--------------|-------|---------------| | ||
46 | * | RESET EEPROM | RESET | DEBUG MODE | | ||
47 | * |--------------|-------|---------------| | ||
48 | * | N/A | N/A | N/A | | ||
49 | * '--------------------------------------' | ||
50 | */ | ||
51 | [2] = | ||
52 | LAYOUT( | ||
53 | KC_NO , KC_NO, KC_TRNS, | ||
54 | EEP_RST, RESET, DEBUG , | ||
55 | KC_NO , KC_NO, KC_NO | ||
56 | ) | ||
57 | |||
58 | }; | ||
59 | |||
60 | const rgblight_segment_t PROGMEM _base_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
61 | {0, RGBLED_NUM, HSV_WHITE} | ||
62 | ); | ||
63 | const rgblight_segment_t PROGMEM _middle_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
64 | {0, RGBLED_NUM, HSV_GREEN} | ||
65 | ); | ||
66 | const rgblight_segment_t PROGMEM _top_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
67 | {0, RGBLED_NUM, HSV_RED} | ||
68 | ); | ||
69 | |||
70 | const rgblight_segment_t* const PROGMEM _rgb_layers[] = | ||
71 | RGBLIGHT_LAYERS_LIST( | ||
72 | _base_layer, | ||
73 | _middle_layer, | ||
74 | _top_layer | ||
75 | ); | ||
76 | |||
77 | void keyboard_post_init_user(void) { | ||
78 | rgblight_layers = _rgb_layers; | ||
79 | } | ||
80 | |||
81 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
82 | |||
83 | switch (get_highest_layer(state)) { | ||
84 | case 0: | ||
85 | rgblight_blink_layer(0, 500); | ||
86 | break; | ||
87 | case 1: | ||
88 | rgblight_blink_layer(1, 500); | ||
89 | break; | ||
90 | case 2: | ||
91 | rgblight_blink_layer(2, 500); | ||
92 | break; | ||
93 | } | ||
94 | return state; | ||
95 | } | ||
96 | |||
97 | uint8_t selected_layer = 0; | ||
98 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
99 | if (index == 0) { | ||
100 | if (layer_state_is(2)) { | ||
101 | if (clockwise) { | ||
102 | tap_code(KC_VOLU); | ||
103 | } else { | ||
104 | tap_code(KC_VOLD); | ||
105 | } | ||
106 | } else { | ||
107 | if (clockwise && selected_layer < (LAYERNUM-2)) { /* Prevent switch to layer 2 using encoder */ | ||
108 | selected_layer++; | ||
109 | layer_move(selected_layer); | ||
110 | } else if (!clockwise && selected_layer > 0) { | ||
111 | selected_layer--; | ||
112 | layer_move(selected_layer); | ||
113 | } | ||
114 | } | ||
115 | } | ||
116 | } | ||
diff --git a/keyboards/mixi/keymaps/default/readme.md b/keyboards/mixi/keymaps/default/readme.md new file mode 100644 index 000000000..863fa6f5d --- /dev/null +++ b/keyboards/mixi/keymaps/default/readme.md | |||
@@ -0,0 +1,10 @@ | |||
1 |  | ||
2 | |||
3 | # Default Mixi Layout | ||
4 | |||
5 | This is the default layout that comes flashed on every Mixi macropad. Layer 1 | ||
6 | and Layer 2 are accessible by rotating the encoder. Layer 3 is not accessible | ||
7 | by the encoder, instead is accessible by holding the [0,2] key on Layer 1. While | ||
8 | Layer 3 is active, rotating the encoder will results in increasing/decreasing | ||
9 | media volume. This layout is expected the encoder is on the left side or [0,0] | ||
10 | key. | ||
diff --git a/keyboards/mixi/keymaps/via/keymap.c b/keyboards/mixi/keymaps/via/keymap.c new file mode 100644 index 000000000..806a7a924 --- /dev/null +++ b/keyboards/mixi/keymaps/via/keymap.c | |||
@@ -0,0 +1,116 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | // please change this value to the desired layer definitions | ||
4 | #define LAYERNUM 3 | ||
5 | |||
6 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
7 | |||
8 | /* | ||
9 | * | Knob: Layer +/- | | ||
10 | * .---------------------------------------. | ||
11 | * | Mute | Play/Pause | Hold: Layer 2 | | ||
12 | * |----------|------------|---------------| | ||
13 | * | Previous | Up | Next | | ||
14 | * |----------|------------|---------------| | ||
15 | * | Left | Down | Right | | ||
16 | * '---------------------------------------' | ||
17 | */ | ||
18 | [0] = | ||
19 | LAYOUT( | ||
20 | KC_MUTE, KC_MPLY, MO(2), | ||
21 | KC_MNXT, KC_UP , KC_MPRV , | ||
22 | KC_LEFT, KC_DOWN , KC_RGHT | ||
23 | ), | ||
24 | |||
25 | /* | ||
26 | * .-----------------------. | ||
27 | * | NUM 7 | NUM 8 | NUM 9 | | ||
28 | * |-------|-------|-------| | ||
29 | * | NUM 4 | NUM 5 | NUM 6 | | ||
30 | * |-------|-------|-------| | ||
31 | * | NUM 1 | NUM 2 | NUM 3 | | ||
32 | * '-----------------------' | ||
33 | */ | ||
34 | [1] = | ||
35 | LAYOUT( | ||
36 | KC_P7, KC_P8, KC_P8, | ||
37 | KC_P4, KC_P5, KC_P6, | ||
38 | KC_P1, KC_P2, KC_P3 | ||
39 | ), | ||
40 | |||
41 | /* | ||
42 | * | Knob: Volume +/- | | ||
43 | * .--------------------------------------. | ||
44 | * | N/A | N/A | Hold: Layer 2 | | ||
45 | * |--------------|-------|---------------| | ||
46 | * | RESET EEPROM | RESET | DEBUG MODE | | ||
47 | * |--------------|-------|---------------| | ||
48 | * | N/A | N/A | N/A | | ||
49 | * '--------------------------------------' | ||
50 | */ | ||
51 | [2] = | ||
52 | LAYOUT( | ||
53 | KC_NO , KC_NO, KC_TRNS, | ||
54 | EEP_RST, RESET, DEBUG , | ||
55 | KC_NO , KC_NO, KC_NO | ||
56 | ) | ||
57 | |||
58 | }; | ||
59 | |||
60 | const rgblight_segment_t PROGMEM _base_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
61 | {0, RGBLED_NUM, HSV_WHITE} | ||
62 | ); | ||
63 | const rgblight_segment_t PROGMEM _middle_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
64 | {0, RGBLED_NUM, HSV_GREEN} | ||
65 | ); | ||
66 | const rgblight_segment_t PROGMEM _top_layer[] = RGBLIGHT_LAYER_SEGMENTS( | ||
67 | {0, RGBLED_NUM, HSV_RED} | ||
68 | ); | ||
69 | |||
70 | const rgblight_segment_t* const PROGMEM _rgb_layers[] = | ||
71 | RGBLIGHT_LAYERS_LIST( | ||
72 | _base_layer, | ||
73 | _middle_layer, | ||
74 | _top_layer | ||
75 | ); | ||
76 | |||
77 | void keyboard_post_init_user(void) { | ||
78 | rgblight_layers = _rgb_layers; | ||
79 | } | ||
80 | |||
81 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
82 | |||
83 | switch (get_highest_layer(state)) { | ||
84 | case 0: | ||
85 | rgblight_blink_layer(0, 500); | ||
86 | break; | ||
87 | case 1: | ||
88 | rgblight_blink_layer(1, 500); | ||
89 | break; | ||
90 | case 2: | ||
91 | rgblight_blink_layer(2, 500); | ||
92 | break; | ||
93 | } | ||
94 | return state; | ||
95 | } | ||
96 | |||
97 | uint8_t selected_layer = 0; | ||
98 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
99 | if (index == 0) { | ||
100 | if (layer_state_is(2)) { | ||
101 | if (clockwise) { | ||
102 | tap_code(KC_VOLU); | ||
103 | } else { | ||
104 | tap_code(KC_VOLD); | ||
105 | } | ||
106 | } else { | ||
107 | if (clockwise && selected_layer < (LAYERNUM-2)) { /* Prevent switch to layer 2 using encoder */ | ||
108 | selected_layer++; | ||
109 | layer_move(selected_layer); | ||
110 | } else if (!clockwise && selected_layer > 0) { | ||
111 | selected_layer--; | ||
112 | layer_move(selected_layer); | ||
113 | } | ||
114 | } | ||
115 | } | ||
116 | } | ||
diff --git a/keyboards/mixi/keymaps/via/rules.mk b/keyboards/mixi/keymaps/via/rules.mk new file mode 100644 index 000000000..36b7ba9cb --- /dev/null +++ b/keyboards/mixi/keymaps/via/rules.mk | |||
@@ -0,0 +1,2 @@ | |||
1 | VIA_ENABLE = yes | ||
2 | LTO_ENABLE = yes | ||
diff --git a/keyboards/mixi/mixi.c b/keyboards/mixi/mixi.c new file mode 100644 index 000000000..533cf3b88 --- /dev/null +++ b/keyboards/mixi/mixi.c | |||
@@ -0,0 +1,13 @@ | |||
1 | #include "mixi.h" | ||
2 | |||
3 | void eeconfig_init_kb(void) { | ||
4 | #ifdef RGBLIGHT_ENABLE | ||
5 | rgblight_enable(); // Enable RGB underglow by default | ||
6 | #ifdef RGBLIGHT_ANIMATIONS | ||
7 | rgblight_mode(RGBLIGHT_MODE_TWINKLE + 5); // Set to RGB_TWINKLE animation by default | ||
8 | #endif | ||
9 | #endif | ||
10 | |||
11 | eeconfig_update_kb(0); | ||
12 | eeconfig_init_user(); | ||
13 | } | ||
diff --git a/keyboards/mixi/mixi.h b/keyboards/mixi/mixi.h new file mode 100644 index 000000000..8b2bc7090 --- /dev/null +++ b/keyboards/mixi/mixi.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #include "quantum.h" | ||
4 | |||
5 | #define LAYOUT( \ | ||
6 | K00, K01, K02, \ | ||
7 | K10, K11, K12, \ | ||
8 | K20, K21, K22 \ | ||
9 | ) { \ | ||
10 | { K00, K01, K02 }, \ | ||
11 | { K10, K11, K12 }, \ | ||
12 | { K20, K21, K22 } \ | ||
13 | } | ||
diff --git a/keyboards/mixi/readme.md b/keyboards/mixi/readme.md new file mode 100644 index 000000000..4c911db57 --- /dev/null +++ b/keyboards/mixi/readme.md | |||
@@ -0,0 +1,15 @@ | |||
1 | # Mixi | ||
2 | |||
3 |  | ||
4 | |||
5 | A mini 3x3 macropad with rotary encoders support and RGB underglow and also tray mount support. Currently the PCB and kits can only be purchased in Indonesia. | ||
6 | |||
7 | * Keyboard Maintainer: [ohchiko](https://github.com/ohchiko) | ||
8 | * Hardware Supported: Mixi PCB, Arduino Pro Micro | ||
9 | * Hardware Availability: [Tokopedia/Sell Stuffs](https://tokopedia.com/sell-stuffs) (Indonesia only). | ||
10 | |||
11 | Make example for this keyboard (after setting up your build environment): | ||
12 | |||
13 | make mixi:default | ||
14 | |||
15 | 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/mixi/rules.mk b/keyboards/mixi/rules.mk new file mode 100644 index 000000000..99b1f1cbc --- /dev/null +++ b/keyboards/mixi/rules.mk | |||
@@ -0,0 +1,27 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | # Teensy halfkay | ||
6 | # Pro Micro caterina | ||
7 | # Atmel DFU atmel-dfu | ||
8 | # LUFA DFU lufa-dfu | ||
9 | # QMK DFU qmk-dfu | ||
10 | # ATmega32A bootloadHID | ||
11 | # ATmega328P USBasp | ||
12 | BOOTLOADER = caterina | ||
13 | |||
14 | # Build Options | ||
15 | # comment out to disable the options. | ||
16 | # | ||
17 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration | ||
18 | MOUSEKEY_ENABLE = no # Mouse keys | ||
19 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
20 | CONSOLE_ENABLE = yes # Console for debug | ||
21 | COMMAND_ENABLE = yes # Commands for debug and configuration | ||
22 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
23 | NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
24 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
25 | RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow | ||
26 | ENCODER_ENABLE = yes | ||
27 | AUDIO_ENABLE = no | ||