Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add keyboard mmk_3 #22569

Merged
merged 27 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a58f6ef
add 3key keyboards
TW59420 Nov 29, 2023
b653147
Update info.json
TW59420 Nov 29, 2023
7cd6421
Update keyboards/mwstudio/mmk_3/halconf.h
TW59420 Dec 2, 2023
f739607
Update keyboards/mwstudio/mmk_3/info.json
TW59420 Dec 2, 2023
09e4915
Update keyboards/mwstudio/mmk_3/info.json
TW59420 Dec 2, 2023
783c8f0
Update keyboards/mwstudio/mmk_3/info.json
TW59420 Dec 2, 2023
4891b0a
Update keyboards/mwstudio/mmk_3/readme.md
TW59420 Dec 2, 2023
e1e688c
Update keyboards/mwstudio/mmk_3/rules.mk
TW59420 Dec 2, 2023
ab3573d
Update keyboards/mwstudio/mmk_3/info.json
TW59420 Dec 2, 2023
885baba
Update keyboards/mwstudio/mmk_3/config.h
TW59420 Dec 2, 2023
02a1e5f
Delete keyboards/mwstudio/mmk_3/mmk_3.c
TW59420 Dec 2, 2023
8d6ba0e
Update info.json
TW59420 Dec 2, 2023
2631e57
Update keyboards/mwstudio/mmk_3/keymaps/default/keymap.c
TW59420 Dec 2, 2023
8a5baeb
Update keymap.c
TW59420 Dec 2, 2023
6e0013a
Update keymap.c
TW59420 Dec 2, 2023
d0c58ba
Update config.h
TW59420 Dec 2, 2023
2dcb0c4
Update keyboards/mwstudio/mmk_3/info.json
TW59420 Dec 3, 2023
f8c6a8a
Update keyboards/mwstudio/mmk_3/readme.md
TW59420 Dec 4, 2023
1ec2891
Update info.json
TW59420 Dec 4, 2023
389f4c1
Update info.json
TW59420 Dec 5, 2023
7fc29ab
Update keyboards/mwstudio/mmk_3/config.h
TW59420 Dec 5, 2023
911c749
Update keyboards/mwstudio/mmk_3/info.json
TW59420 Dec 5, 2023
6f14f33
Update keyboards/mwstudio/mmk_3/info.json
TW59420 Dec 5, 2023
d47c20a
format keymap.c
TW59420 Dec 5, 2023
2f49d21
Update keymap.c
TW59420 Dec 5, 2023
517f704
Update keyboards/mwstudio/mmk_3/info.json
TW59420 Dec 10, 2023
0250205
Merge branch 'master' into mmk_3
drashna Dec 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions keyboards/mwstudio/mmk_3/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2023 TW59420 <https://github.com/TW59420>
*
* 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/>.
*/

#pragma once

#define RGBLIGHT_LAYERS
#define RGBLIGHT_DEFAULT_MODE RGBLIGHT_MODE_RAINBOW_SWIRL + 5

#define WS2812_PWM_DRIVER PWMD4
#define WS2812_PWM_CHANNEL 3
#define WS2812_PWM_PAL_MODE 1
#define WS2812_DMA_STREAM STM32_DMA1_STREAM7
#define WS2812_DMA_CHANNEL 2
22 changes: 22 additions & 0 deletions keyboards/mwstudio/mmk_3/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* Copyright 2022 TW59420 <https://github.com/TW59420>
*
* 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/>.
*/

#pragma once

#define HAL_USE_PWM TRUE

#include_next <halconf.h>

53 changes: 53 additions & 0 deletions keyboards/mwstudio/mmk_3/info.json
TW59420 marked this conversation as resolved.
Show resolved Hide resolved
TW59420 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"manufacturer": "MWStudio",
"keyboard_name": "MMK_3",
"maintainer": "TW59420",
"bootloader": "stm32duino",
"diode_direction": "ROW2COL",
"features": {
"bootmagic": true,
"extrakey": true,
"mousekey": false,
"nkro": true,
"rgblight": true
},
"matrix_pins": {
"cols": ["A3", "A4", "A5"],
"rows": ["A6"]
Comment on lines +15 to +16
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could have used direct pin, when designing (eg, GPIO to GND for each).

},
"processor": "STM32F103",
"rgblight": {
"animations": {
"alternating": true,
"breathing": true,
"christmas": true,
"knight": true,
"rainbow_mood": true,
"rainbow_swirl": true,
"snake": true,
"static_gradient": true,
"twinkle": true
},
"hue_steps": 10,
"led_count": 5
},
"url": "",
"usb": {
"device_version": "1.0.0",
"pid": "0x3001",
"vid": "0x7BA1"
},
"ws2812": {
"driver": "pwm"
"pin": "B8",
},
"layouts": {
"LAYOUT": {
"layout": [
{ "matrix": [0, 0], "x": 0, "y": 0 },
{ "matrix": [0, 1], "x": 1, "y": 0 },
{ "matrix": [0, 2], "x": 2, "y": 0 }
]
}
}
}
26 changes: 26 additions & 0 deletions keyboards/mwstudio/mmk_3/keymaps/default/keymap.c
TW59420 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2023 TW59420 <https://github.com/TW59420>
*
* 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
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[0] = LAYOUT(LT(3, KC_LCTL), LT(1, KC_C), LT(2, KC_V)),

[1] = LAYOUT(RGB_VAD, KC_TRNS, RGB_VAI),

[2] = LAYOUT(RGB_SAD, RGB_SAI, KC_TRNS),

[3] = LAYOUT(KC_TRNS, RGB_HUD, RGB_HUI)};
47 changes: 47 additions & 0 deletions keyboards/mwstudio/mmk_3/keymaps/via/keymap.c
TW59420 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Copyright 2023 TW59420 <https://github.com/TW59420>
*
* 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

const rgblight_segment_t PROGMEM my_layer0_dfu[] = RGBLIGHT_LAYER_SEGMENTS({3, 2, HSV_WHITE});
const rgblight_segment_t PROGMEM my_layer1_val[] = RGBLIGHT_LAYER_SEGMENTS({3, 2, HSV_BLUE});
const rgblight_segment_t PROGMEM my_layer2_sat[] = RGBLIGHT_LAYER_SEGMENTS({3, 2, HSV_PURPLE});
const rgblight_segment_t PROGMEM my_layer3_hue[] = RGBLIGHT_LAYER_SEGMENTS({3, 2, HSV_RED});

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

[0] = LAYOUT(LT(3, KC_LCTL), LT(1, KC_C), LT(2, KC_V)),

[1] = LAYOUT(RGB_VAD, KC_TRNS, RGB_VAI),

[2] = LAYOUT(RGB_SAD, RGB_SAI, KC_TRNS),

[3] = LAYOUT(KC_TRNS, RGB_HUD, RGB_HUI)};

const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(my_layer0_dfu, my_layer1_val, my_layer2_sat, my_layer3_hue);

void keyboard_post_init_user(void) {
// Enable the LED layers
rgblight_layers = my_rgb_layers;
}

layer_state_t layer_state_set_user(layer_state_t state) {
rgblight_set_layer_state(0, layer_state_cmp(state, 0));
rgblight_set_layer_state(1, layer_state_cmp(state, 1));
rgblight_set_layer_state(2, layer_state_cmp(state, 2));
rgblight_set_layer_state(3, layer_state_cmp(state, 3));
return state;
}
2 changes: 2 additions & 0 deletions keyboards/mwstudio/mmk_3/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
LTO_ENABLE = yes
23 changes: 23 additions & 0 deletions keyboards/mwstudio/mmk_3/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Copyright 2023 TW59420 <https://github.com/TW59420>
*
* 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/>.
*/
#pragma once

#include_next <mcuconf.h>

#undef STM32_PWM_USE_TIM4
#define STM32_PWM_USE_TIM4 TRUE


22 changes: 22 additions & 0 deletions keyboards/mwstudio/mmk_3/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# 3Key

![3Key](https://i.imgur.com/WuwlVknh.jpeg)

Support APM32F103C8T6 keyboard.

* Keyboard Maintainer: [TW59420](https://github.com/TW59420)
* Hardware Supported: APM32F103C8T6

Make example for this keyboard (after setting up your build environment):

make mwstudio/mmk_3:default

Flashing example for this keyboard:

make mwstudio/mmk_3: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
* **Physical reset button**: Short press the button on the back of the PCB to enter the Bootloader and flash the firmware
* **Keycode in layout**: Press the key mapped to RESET if it is available
1 change: 1 addition & 0 deletions keyboards/mwstudio/mmk_3/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file intentionally left blank