Skip to content

Commit 0e24765

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents 57b9b45 + bf959d7 commit 0e24765

File tree

9 files changed

+237
-0
lines changed

9 files changed

+237
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
Copyright 2020 Swiftrax <[email protected]>
3+
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation, either version 2 of the License, or
7+
(at your option) any later version.
8+
9+
This program is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
GNU General Public License for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#pragma once
19+
20+
#include "config_common.h"
21+
22+
/* USB Device descriptor parameter */
23+
#define VENDOR_ID 0x04D8
24+
#define PRODUCT_ID 0xEA68
25+
#define DEVICE_VER 0x0001
26+
#define MANUFACTURER Swiftrax
27+
#define PRODUCT Joypad
28+
29+
/* key matrix size */
30+
#define MATRIX_ROWS 6
31+
#define MATRIX_COLS 4
32+
33+
// ROWS: Top to bottom, COLS: Left to right
34+
35+
#define MATRIX_ROW_PINS { C6, B3, B0, B1, D6, D5 }
36+
#define MATRIX_COL_PINS { C7, B4, D0, C2 }
37+
38+
#define ENCODERS_PAD_A { C5 }
39+
#define ENCODERS_PAD_B { C4 }
40+
41+
/* COL2ROW or ROW2COL */
42+
#define DIODE_DIRECTION COL2ROW
43+
44+
45+
/* define if matrix has ghost */
46+
//#define MATRIX_HAS_GHOST
47+
48+
/* Set 0 if debouncing isn't needed */
49+
#define DEBOUNCE 5
50+
51+
/*EEPROM for via*/
52+
#define DYNAMIC_KEYMAP_LAYER_COUNT 3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"keyboard_name": "Joypad",
3+
"url": "https://github.com/swiftrax",
4+
"maintainer": "swiftrax",
5+
"width": 4,
6+
"height": 6.25,
7+
"layouts": {
8+
"LAYOUT_ortho_6x4": {
9+
"layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1.25}, {"x":1, "y":1.25}, {"x":2, "y":1.25}, {"x":3, "y":1.25}, {"x":0, "y":2.25}, {"x":1, "y":2.25}, {"x":2, "y":2.25}, {"x":3, "y":2.25}, {"x":0, "y":3.25}, {"x":1, "y":3.25}, {"x":2, "y":3.25}, {"x":3, "y":3.25}, {"x":0, "y":4.25}, {"x":1, "y":4.25}, {"x":2, "y":4.25}, {"x":3, "y":4.25}, {"x":0, "y":5.25}, {"x":1, "y":5.25}, {"x":2, "y":5.25}, {"x":3, "y":5.25}]
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* Copyright 2020 swiftrax
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
#include "joypad.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* Copyright 2020 swiftrax
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
#pragma once
17+
18+
#include "quantum.h"
19+
#define LAYOUT_ortho_6x4( \
20+
K00, K01, K02, K03, \
21+
K10, K11, K12, K13, \
22+
K20, K21, K22, K23, \
23+
K30, K31, K32, K33, \
24+
K40, K41, K42, K43, \
25+
K50, K51, K52, K53 \
26+
) { \
27+
{K00, K01, K02, K03}, \
28+
{K10, K11, K12, K13}, \
29+
{K20, K21, K22, K23}, \
30+
{K30, K31, K32, K33}, \
31+
{K40, K41, K42, K43}, \
32+
{K50, K51, K52, K53} \
33+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* Copyright 2020 swiftrax
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
#include QMK_KEYBOARD_H
17+
18+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19+
20+
[0] = LAYOUT_ortho_6x4(
21+
KC_MUTE, KC_F13 , KC_F14 , KC_F15 ,
22+
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
23+
KC_P7 , KC_P8 , KC_P9 , KC_PPLS,
24+
KC_P4 , KC_P5 , KC_P6 , KC_PPLS,
25+
KC_P1 , KC_P2 , KC_P3 , KC_PENT,
26+
KC_P0 , KC_P0 , KC_PDOT, KC_PENT),
27+
28+
};
29+
30+
void encoder_update_user(uint8_t index, bool clockwise) {
31+
if (clockwise) {
32+
tap_code(KC_VOLU);
33+
} else {
34+
tap_code(KC_VOLD);
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* Copyright 2020 swiftrax
2+
*
3+
* This program is free software: you can redistribute it and/or modify
4+
* it under the terms of the GNU General Public License as published by
5+
* the Free Software Foundation, either version 2 of the License, or
6+
* (at your option) any later version.
7+
*
8+
* This program is distributed in the hope that it will be useful,
9+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
* GNU General Public License for more details.
12+
*
13+
* You should have received a copy of the GNU General Public License
14+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
*/
16+
#include QMK_KEYBOARD_H
17+
18+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19+
20+
[0] = LAYOUT_ortho_6x4(
21+
KC_MUTE, KC_F13 , KC_F14 , KC_F15 ,
22+
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
23+
KC_P7 , KC_P8 , KC_P9 , KC_PPLS,
24+
KC_P4 , KC_P5 , KC_P6 , KC_PPLS,
25+
KC_P1 , KC_P2 , KC_P3 , KC_PENT,
26+
KC_P0 , KC_P0 , KC_PDOT, KC_PENT),
27+
28+
[1] = LAYOUT_ortho_6x4(
29+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
30+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
31+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
32+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
33+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
34+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
35+
36+
[2] = LAYOUT_ortho_6x4(
37+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
38+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
39+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
40+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
41+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
42+
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
43+
};
44+
45+
void encoder_update_user(uint8_t index, bool clockwise) {
46+
if (clockwise) {
47+
tap_code(KC_VOLU);
48+
} else {
49+
tap_code(KC_VOLD);
50+
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
VIA_ENABLE = yes
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Joypad
2+
3+
Numberpad with 1 encoder
4+
5+
* Keyboard Maintainer: Swiftrax
6+
* Hardware Supported: Joypad PCB
7+
* Hardware Availability: https://github.com/swiftrax
8+
9+
Make example for this keyboard (after setting up your build environment):
10+
11+
make handwired/swiftrax/joypad:default
12+
13+
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).
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# MCU name
2+
MCU = atmega32u2
3+
4+
# Bootloader selection
5+
BOOTLOADER = atmel-dfu
6+
7+
# Build Options
8+
# change yes to no to disable
9+
#
10+
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11+
MOUSEKEY_ENABLE = no # Mouse keys
12+
EXTRAKEY_ENABLE = yes # Audio control and System control
13+
CONSOLE_ENABLE = no # Console for debug
14+
COMMAND_ENABLE = no # Commands for debug and configuration
15+
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16+
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
17+
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
18+
NKRO_ENABLE = no # USB Nkey Rollover
19+
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20+
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
21+
BLUETOOTH_ENABLE = no # Enable Bluetooth
22+
AUDIO_ENABLE = no # Audio output
23+
ENCODER_ENABLE = yes

0 commit comments

Comments
 (0)