Skip to content

Commit

Permalink
Add MMkeyboard Class60 (qmk#22972)
Browse files Browse the repository at this point in the history
Co-authored-by: jack <[email protected]>
Co-authored-by: Drashna Jaelre <[email protected]>
Co-authored-by: Duncan Sutherland <[email protected]>
Co-authored-by: Joel Challis <[email protected]>
  • Loading branch information
5 people authored and nuess0r committed Sep 8, 2024
1 parent 3d9b952 commit 0ea05ad
Show file tree
Hide file tree
Showing 10 changed files with 1,153 additions and 0 deletions.
28 changes: 28 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define SOLENOID_PIN B3
#define HAPTIC_ENABLE_PIN A15
#define SOLENOID_DEFAULT_DWELL 4
#define SOLENOID_MIN_DWELL 4
#define SOLENOID_MAX_DWELL 45
#define HAPTIC_OFF_IN_LOW_POWER 1
#define NO_HAPTIC_MOD

#define AUDIO_CLICKY
#define AUDIO_PIN A6
#define AUDIO_PWM_DRIVER PWMD3
#define AUDIO_PWM_CHANNEL 1
#define AUDIO_STATE_TIMER GPTD4
#define AUDIO_PIN_ALT_AS_NEGATIVE
#define AUDIO_PIN_ALT A13
#define DEFAULT_LAYER_SONGS { \
SONG(CAPS_LOCK_ON_SOUND), \
SONG(CAPS_LOCK_OFF_SOUND), \
SONG(NUM_LOCK_ON_SOUND), \
SONG(NUM_LOCK_OFF_SOUND), \
SONG(SCROLL_LOCK_ON_SOUND), \
SONG(SCROLL_LOCK_OFF_SOUND) \
}
10 changes: 10 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Copyright 2024 QMK
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#define HAL_USE_GPT TRUE
#define HAL_USE_PWM TRUE
#define HAL_USE_PAL TRUE

#include_next <halconf.h>
961 changes: 961 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/keyboard.json

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

enum layer_names {
_BASE,
_FN1,
};

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

[_BASE] = LAYOUT_all(
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_BSPC, KC_DEL,
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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUBS, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_HOME,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RALT, MO(1), KC_RCTL
),

[_FN1] = LAYOUT_all(
KC_GRV, 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_DEL, KC_TRNS,
KC_TRNS, AU_ON, AU_OFF, CK_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_UP, KC_TRNS, KC_TRNS,
KC_TRNS, CK_ON, CK_OFF, CK_UP, CK_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, HF_ON, HF_OFF, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_DOWN, KC_TRNS, KC_END,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT
),

};
29 changes: 29 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

enum layer_names {
_BASE,
_FN1,
};

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

[_BASE] = LAYOUT_all(
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_BSPC, KC_DEL,
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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUBS, KC_ENT,
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_HOME,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RALT, MO(1), KC_RCTL
),

[_FN1] = LAYOUT_all(
KC_GRV, 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_DEL, KC_TRNS,
KC_TRNS, AU_ON, AU_OFF, CK_RST, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_UP, KC_TRNS, KC_TRNS,
KC_TRNS, CK_ON, CK_OFF, CK_UP, CK_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, HF_ON, HF_OFF, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_DOWN, KC_TRNS, KC_END,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT
),

};
1 change: 1 addition & 0 deletions keyboards/mmkeyboard/class60/soldered/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VIA_ENABLE = yes # Enable support for VIA
24 changes: 24 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright 2020 Nick Brassel (tzarc)
*
* 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 3 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 <https://www.gnu.org/licenses/>.
*/
#pragma once

#include_next <mcuconf.h>

#undef STM32_PWM_USE_TIM3
#define STM32_PWM_USE_TIM3 TRUE

#undef STM32_GPT_USE_TIM4
#define STM32_GPT_USE_TIM4 TRUE
27 changes: 27 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Class60

![Class60 E-Retro White](https://i.imgur.com/9T0KbBHh.jpeg)

The Class60 is a Leaf-spring/Top dual mounting 60% Keyboard that includes a buzzer and solenoid.

* Keyboard Maintainer: [lexbrugman](https://github.com/lexbrugman)
* Hardware Supported: Class60 soldered PCB
* Hardware Availability: https://www.mmkeyboard.com/products/mm-class60-retro-custom-mechanical-keyboard

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

make mmkeyboard/class60/soldered:default

Flashing example for this keyboard:

make mmkeyboard/class60/soldered: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 3 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
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
2 changes: 2 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
HAPTIC_DRIVER = solenoid
AUDIO_DRIVER = pwm_software
42 changes: 42 additions & 0 deletions keyboards/mmkeyboard/class60/soldered/soldered.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2023 QMK
// SPDX-License-Identifier: GPL-2.0-or-later

#include "quantum.h"

#ifdef AUDIO_ENABLE
float caps_on[][2] = SONG(CAPS_LOCK_ON_SOUND);
float caps_off[][2] = SONG(CAPS_LOCK_OFF_SOUND);

float num_on[][2] = SONG(NUM_LOCK_ON_SOUND);
float num_off[][2] = SONG(NUM_LOCK_OFF_SOUND);

float scroll_on[][2] = SONG(SCROLL_LOCK_ON_SOUND);
float scroll_off[][2] = SONG(SCROLL_LOCK_OFF_SOUND);

bool led_update_kb(led_t led_state) {
bool res = led_update_user(led_state);
if (res) {
led_update_ports(led_state);

static uint8_t caps_state = 0;
if (caps_state != led_state.caps_lock) {
led_state.caps_lock ? PLAY_SONG(caps_on) : PLAY_SONG(caps_off);
caps_state = led_state.caps_lock;
}

static uint8_t num_state = 0;
if (num_state != led_state.num_lock) {
led_state.num_lock ? PLAY_SONG(num_on) : PLAY_SONG(num_off);
num_state = led_state.num_lock;
}

static uint8_t scroll_state = 0;
if (scroll_state != led_state.scroll_lock) {
led_state.scroll_lock ? PLAY_SONG(scroll_on) : PLAY_SONG(scroll_off);
scroll_state = led_state.scroll_lock;
}
}

return res;
}
#endif

0 comments on commit 0ea05ad

Please sign in to comment.