Skip to content

Commit

Permalink
[Keyboard] Add GMMK Numpad (qmk#20067)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergey Vlasov <[email protected]>
Co-authored-by: Drashna Jaelre <[email protected]>
  • Loading branch information
3 people authored and coquizen committed Apr 6, 2023
1 parent 7f2e19e commit 505032e
Show file tree
Hide file tree
Showing 12 changed files with 684 additions and 0 deletions.
84 changes: 84 additions & 0 deletions keyboards/gmmk/numpad/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/* Copyright 2021 Glorious, LLC <[email protected]>
* Modified 2022 by rustedaperture for qmk_firmware
*
* 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 SLIDER_PIN B0
#define MIDI_ADVANCED

#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE

#define SPI_DRIVER SPIDQ
#define SPI_SCK_PIN B3
#define SPI_MOSI_PIN B5
#define SPI_MISO_PIN B4

#define DRIVER_1_CS B12
#define DRIVER_1_EN A15
#define DRIVER_1_PW_EN B13

#define DRIVER_COUNT 1

#define RGB_MATRIX_LED_COUNT 31

#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B6
#define WEAR_LEVELING_BACKING_SIZE 2048

#define ENABLE_RGB_MATRIX_ALPHAS_MODS
#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_BREATHING
#define ENABLE_RGB_MATRIX_BAND_SAT
#define ENABLE_RGB_MATRIX_BAND_VAL
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
#define ENABLE_RGB_MATRIX_CYCLE_ALL
#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
#define ENABLE_RGB_MATRIX_DUAL_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_BEACON
#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
#define ENABLE_RGB_MATRIX_RAINDROPS
#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
#define ENABLE_RGB_MATRIX_HUE_BREATHING
#define ENABLE_RGB_MATRIX_HUE_PENDULUM
#define ENABLE_RGB_MATRIX_HUE_WAVE
#define ENABLE_RGB_MATRIX_PIXEL_RAIN
#define ENABLE_RGB_MATRIX_PIXEL_FLOW
#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL
#define ENABLE_RGB_MATRIX_TYPING_HEATMAP
#define ENABLE_RGB_MATRIX_DIGITAL_RAIN
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
#define ENABLE_RGB_MATRIX_SPLASH
#define ENABLE_RGB_MATRIX_MULTISPLASH
#define ENABLE_RGB_MATRIX_SOLID_SPLASH
#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
26 changes: 26 additions & 0 deletions keyboards/gmmk/numpad/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Copyright 2021 Glorious, LLC <[email protected]>
* Modified 2022 by rustedaperture for qmk_firmware
*
* 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_SPI TRUE
#define SPI_USE_WAIT TRUE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
#define HAL_USE_ADC TRUE


#include_next <halconf.h>
51 changes: 51 additions & 0 deletions keyboards/gmmk/numpad/info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"keyboard_name": "GMMK Numpad",
"manufacturer": "Glorious",
"url": "https://www.gloriousgaming.com/products/gmmk-numpad",
"maintainer": "GloriousThrall",
"usb": {
"vid": "0x320F",
"pid": "0x5088",
"device_version": "0.0.1"
},
"encoder": {
"rotary": [
{"pin_a": "A2", "pin_b": "A1"}
]
},
"processor": "WB32F3G71",
"bootloader": "wb32-dfu",
"diode_direction": "ROW2COL",
"matrix_pins": {
"rows": ["A3", "A4", "A5", "A6", "A7"],
"cols": ["B7", "B1", "B10", "B11"]
},
"layouts": {
"LAYOUT": {
"layout": [
{"label": "NUM", "matrix": [0, 0], "x": 0, "y": 0},
{"label": "/", "matrix": [0, 1], "x": 1, "y": 0},
{"label": "*", "matrix": [0, 2], "x": 2, "y": 0},
{"label": "-", "matrix": [0, 3], "x": 3, "y": 0},

{"label": "7", "matrix": [1, 0], "x": 0, "y": 1},
{"label": "8", "matrix": [1, 1], "x": 1, "y": 1},
{"label": "9", "matrix": [1, 2], "x": 2, "y": 1},
{"label": "+", "matrix": [1, 3], "x": 3, "y": 1, "h": 2},

{"label": "4", "matrix": [2, 0], "x": 0, "y": 2},
{"label": "5", "matrix": [2, 1], "x": 1, "y": 2},
{"label": "6", "matrix": [2, 2], "x": 2, "y": 2},
{"label": "CALC", "matrix": [2, 3], "x": 3, "y": 2},

{"label": "1", "matrix": [3, 0], "x": 0, "y": 3},
{"label": "2", "matrix": [3, 1], "x": 1, "y": 3},
{"label": "3", "matrix": [3, 2], "x": 2, "y": 3},
{"label": "RET", "matrix": [3, 3], "x": 3, "y": 3, "h": 2},

{"label": "0", "matrix": [4, 0], "x": 0, "y": 4, "w": 2},
{"label": ".", "matrix": [4, 3], "x": 3, "y": 4}
]
}
}
}
60 changes: 60 additions & 0 deletions keyboards/gmmk/numpad/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* Copyright 2021 Glorious, LLC <[email protected]>
* Modified 2022 by rustedaperture for qmk_firmware
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 "analog.h"
#include "qmk_midi.h"

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

// NUM / * -
// 7 8 9 +
// 4 5 6 ENCODER
// 1 2 3 RET
// 0 .

[0] = LAYOUT(
MO(1), KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_CALC,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_PDOT
),
[1] = LAYOUT(
_______, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, RGB_VAI, KC_P9, KC_PPLS,
RGB_RMOD, KC_P5, RGB_MOD, KC_CALC,
KC_P1, RGB_VAD, KC_P3, KC_PENT,
RGB_TOG, QK_BOOT
)
};

// Potentiometer Slider, MIDI Control

uint8_t divisor = 0;

void slider(void) {
if (divisor++) { /* only run the slider function 1/256 times it's called */
return;
}
midi_send_cc(&midi_device, 2, 0x3E, 0x7F + (analogReadPin(SLIDER_PIN) >> 3));
}

void housekeeping_task_user(void) {
slider();
}
79 changes: 79 additions & 0 deletions keyboards/gmmk/numpad/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/* Copyright 2021 Glorious, LLC <[email protected]>
Modified 2022 by rustedaperture for qmk_firmware
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 "analog.h"
#include "qmk_midi.h"

// clang-format off
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

// NUM / * -
// 7 8 9 +
// 4 5 6 ENCODER
// 1 2 3 RET
// 0 .

[0] = LAYOUT(
MO(1), KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_CALC,
KC_P1, KC_P2, KC_P3, KC_PENT,
KC_P0, KC_PDOT
),
[1] = LAYOUT(
_______, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, RGB_VAI, KC_P9, KC_PPLS,
RGB_RMOD, KC_P5, RGB_MOD, KC_CALC,
KC_P1, RGB_VAD, KC_P3, KC_PENT,
RGB_TOG, QK_BOOT
),
[2] = LAYOUT(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______
),
[3] = LAYOUT(
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______, _______, _______,
_______, _______
),
};
// clang-format on

const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
[3] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }
};

// Potentiometer Slider, MIDI Control

uint8_t divisor = 0;

void slider(void) {
if (divisor++) { /* only run the slider function 1/256 times it's called */
return;
}
midi_send_cc(&midi_device, 2, 0x3E, 0x7F + (analogReadPin(SLIDER_PIN) >> 3));
}

void housekeeping_task_user(void) {
slider();
}
2 changes: 2 additions & 0 deletions keyboards/gmmk/numpad/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE=yes
ENCODER_MAP_ENABLE=yes
Loading

0 comments on commit 505032e

Please sign in to comment.