aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlabahuy <rezzaadio@gmail.com>2020-12-17 04:02:47 +0700
committerGitHub <noreply@github.com>2020-12-16 13:02:47 -0800
commit11669bb45bd433af49d14b2836b208ed6d0877f3 (patch)
treebc6e63134f8fb47b9dc313d0b6fe86af66fee268
parent3295ac90ee9d0c0d4dc9c22bf107c9713f422696 (diff)
downloadqmk_firmware-11669bb45bd433af49d14b2836b208ed6d0877f3.tar.gz
qmk_firmware-11669bb45bd433af49d14b2836b208ed6d0877f3.zip
[Keyboard] Add rart/rart4x4 with VIA support (#11095)
* Create config.h * Create info.json * Create rart4x4.c * Create rart4x4.h * Create readme.md * Create rules.mk * Create keymap.c * Create keymap.c * Rename keyboards/rart/rart4x4/default/keymap.c to keyboards/rart/rart4x4/keymaps/default/keymap.c * Rename keyboards/rart/rart4x4/via/keymap.c to keyboards/rart/rart4x4/keymaps/via/keymap.c * Create rules.mk * Update info.json * Update keymap.c * Update rart4x4.h * Update rules.mk
-rw-r--r--keyboards/rart/rart4x4/config.h62
-rw-r--r--keyboards/rart/rart4x4/info.json32
-rw-r--r--keyboards/rart/rart4x4/keymaps/default/keymap.c51
-rw-r--r--keyboards/rart/rart4x4/keymaps/via/keymap.c61
-rw-r--r--keyboards/rart/rart4x4/keymaps/via/rules.mk1
-rw-r--r--keyboards/rart/rart4x4/rart4x4.c15
-rw-r--r--keyboards/rart/rart4x4/rart4x4.h37
-rw-r--r--keyboards/rart/rart4x4/readme.md14
-rw-r--r--keyboards/rart/rart4x4/rules.mk25
9 files changed, 298 insertions, 0 deletions
diff --git a/keyboards/rart/rart4x4/config.h b/keyboards/rart/rart4x4/config.h
new file mode 100644
index 000000000..0d79e3140
--- /dev/null
+++ b/keyboards/rart/rart4x4/config.h
@@ -0,0 +1,62 @@
1/*
2Copyright 2020 Alabahuy
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along 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 0x414C
24#define PRODUCT_ID 0x0004
25#define DEVICE_VER 0x0001
26#define MANUFACTURER Alabahuy
27#define PRODUCT RART4X4
28
29/* key matrix size */
30#define MATRIX_ROWS 4
31#define MATRIX_COLS 4
32
33/* key matrix pins */
34#define MATRIX_ROW_PINS { F4, B6, B3, B1 }
35#define MATRIX_COL_PINS { F7, B2, B5, B4 }
36#define UNUSED_PINS
37
38/* COL2ROW or ROW2COL */
39#define DIODE_DIRECTION COL2ROW
40
41/* Set 0 if debouncing isn't needed */
42#define DEBOUNCE 5
43
44/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
45#define LOCKING_SUPPORT_ENABLE
46
47/* Locking resynchronize hack */
48#define LOCKING_RESYNC_ENABLE
49
50#define ENCODERS_PAD_A { F6, D7 }
51#define ENCODERS_PAD_B { F5, E6 }
52
53#define RGB_DI_PIN D3
54#ifdef RGB_DI_PIN
55#define RGBLIGHT_ANIMATIONS
56#define RGBLED_NUM 5
57#define RGBLIGHT_HUE_STEP 8
58#define RGBLIGHT_SAT_STEP 8
59#define RGBLIGHT_VAL_STEP 8
60#define RGBLIGHT_LIMIT_VAL 240
61#define RGBLIGHT_SLEEP
62#endif
diff --git a/keyboards/rart/rart4x4/info.json b/keyboards/rart/rart4x4/info.json
new file mode 100644
index 000000000..a115f3a64
--- /dev/null
+++ b/keyboards/rart/rart4x4/info.json
@@ -0,0 +1,32 @@
1{
2 "keyboard_name": "RART4X4",
3 "url": "",
4 "maintainer": "Alabahuy",
5 "width": 4,
6 "height": 4,
7 "layouts": {
8 "LAYOUT_ortho_4x4": {
9 "layout": [
10 {"label": "Numlock", "x": 0, "y": 0},
11 {"label": "/", "x": 1, "y": 0},
12 {"label": "*", "x": 2, "y": 0},
13 {"label": "-", "x": 3, "y": 0},
14
15 {"label": "7", "x": 0, "y": 1},
16 {"label": "8", "x": 1, "y": 1},
17 {"label": "9", "x": 2, "y": 1},
18 {"label": "=", "x": 3, "y": 1},
19
20 {"label": "4", "x": 0, "y": 2},
21 {"label": "5", "x": 1, "y": 2},
22 {"label": "6", "x": 2, "y": 2},
23 {"label": "+", "x": 3, "y": 2},
24
25 {"label": "1", "x": 0, "y": 3},
26 {"label": "2", "x": 1, "y": 3},
27 {"label": "3", "x": 2, "y": 3},
28 {"label": "Esc", "x": 3, "y": 3},
29 ]
30 }
31 }
32}
diff --git a/keyboards/rart/rart4x4/keymaps/default/keymap.c b/keyboards/rart/rart4x4/keymaps/default/keymap.c
new file mode 100644
index 000000000..36680e357
--- /dev/null
+++ b/keyboards/rart/rart4x4/keymaps/default/keymap.c
@@ -0,0 +1,51 @@
1/*
2Copyright 2020 Alabahuy
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#include QMK_KEYBOARD_H
18
19
20const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
21
22 [0] = LAYOUT_ortho_4x4(
23 KC_NLCK, KC_PSLS, KC_PAST, MO(1),
24 KC_P7, KC_P8, KC_P9, KC_PEQL,
25 KC_P4, KC_P5, KC_P6, KC_PPLS,
26 KC_P1, KC_P2, KC_P3, KC_PENT
27 ),
28
29 [1] = LAYOUT_ortho_4x4(
30 KC_TRNS, RGB_HUI, RGB_HUD, KC_TRNS,
31 RGB_SAI, RGB_SAD, KC_MNXT, KC_MPRV,
32 RGB_VAI, RGB_VAD, KC_MSTP, KC_MPLY,
33 KC_COPY, KC_PSTE, KC_MYCM, RGB_TOG
34 )
35};
36
37void encoder_update_user(uint8_t index, bool clockwise) {
38 if (index == 0) { /* First encoder */
39 if (clockwise) {
40 tap_code(KC_VOLD);
41 } else {
42 tap_code(KC_VOLU);
43 }
44 } else if (index == 1) { /* Second encoder */
45 if (clockwise) {
46 tap_code(KC_WH_D);
47 } else {
48 tap_code(KC_WH_U);
49 }
50 }
51}
diff --git a/keyboards/rart/rart4x4/keymaps/via/keymap.c b/keyboards/rart/rart4x4/keymaps/via/keymap.c
new file mode 100644
index 000000000..9407b5f33
--- /dev/null
+++ b/keyboards/rart/rart4x4/keymaps/via/keymap.c
@@ -0,0 +1,61 @@
1/*
2Copyright 2020 Alabahuy
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14#include QMK_KEYBOARD_H
15
16const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
17
18 [0] = LAYOUT_ortho_4x4(
19 KC_NLCK, KC_PSLS, KC_PAST, MO(1),
20 KC_P7, KC_P8, KC_P9, KC_PEQL,
21 KC_P4, KC_P5, KC_P6, KC_PPLS,
22 KC_P1, KC_P2, KC_P3, KC_PMNS
23 ),
24
25 [1] = LAYOUT_ortho_4x4(
26 KC_TRNS, RGB_HUI, RGB_HUD, RESET,
27 RGB_SAI, RGB_SAD, KC_MNXT, KC_MPRV,
28 RGB_VAI, RGB_VAD, KC_MSTP, KC_MPLY,
29 KC_COPY, KC_PSTE, KC_MYCM, RGB_TOG
30 ),
31
32 [2] = LAYOUT_ortho_4x4(
33 _______, _______, _______, _______,
34 _______, _______, _______, _______,
35 _______, _______, _______, _______,
36 _______, _______, _______, _______
37 ),
38
39 [3] = LAYOUT_ortho_4x4(
40 _______, _______, _______, _______,
41 _______, _______, _______, _______,
42 _______, _______, _______, _______,
43 _______, _______, _______, _______
44 )
45};
46
47void encoder_update_user(uint8_t index, bool clockwise) {
48 if (index == 0) { /* First encoder */
49 if (clockwise) {
50 tap_code(KC_WH_U);
51 } else {
52 tap_code(KC_WH_D);
53 }
54 } else if (index == 1) { /* Second encoder */
55 if (clockwise) {
56 tap_code(KC_VOLU);
57 } else {
58 tap_code(KC_VOLD);
59 }
60 }
61}
diff --git a/keyboards/rart/rart4x4/keymaps/via/rules.mk b/keyboards/rart/rart4x4/keymaps/via/rules.mk
new file mode 100644
index 000000000..1e5b99807
--- /dev/null
+++ b/keyboards/rart/rart4x4/keymaps/via/rules.mk
@@ -0,0 +1 @@
VIA_ENABLE = yes
diff --git a/keyboards/rart/rart4x4/rart4x4.c b/keyboards/rart/rart4x4/rart4x4.c
new file mode 100644
index 000000000..0d5e2dbad
--- /dev/null
+++ b/keyboards/rart/rart4x4/rart4x4.c
@@ -0,0 +1,15 @@
1/* Copyright 2020 Alabahuy
2 * This program is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 */
15#include "rart4x4.h"
diff --git a/keyboards/rart/rart4x4/rart4x4.h b/keyboards/rart/rart4x4/rart4x4.h
new file mode 100644
index 000000000..8160420aa
--- /dev/null
+++ b/keyboards/rart/rart4x4/rart4x4.h
@@ -0,0 +1,37 @@
1/*
2Copyright 2020 Alabahuy
3This program is free software: you can redistribute it and/or modify
4it under the terms of the GNU General Public License as published by
5the Free Software Foundation, either version 2 of the License, or
6(at your option) any later version.
7This program is distributed in the hope that it will be useful,
8but WITHOUT ANY WARRANTY; without even the implied warranty of
9MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10GNU General Public License for more details.
11You should have received a copy of the GNU General Public License
12along with this program. If not, see <http://www.gnu.org/licenses/>.
13*/
14#pragma once
15
16#include "quantum.h"
17
18/* This a shortcut to help you visually see your layout.
19 *
20 * The first section contains all of the arguments representing the physical
21 * layout of the board and position of the keys.
22 *
23 * The second converts the arguments into a two-dimensional array which
24 * represents the switch matrix.
25 */
26#define LAYOUT_ortho_4x4( \
27 K00, K01, K02, K03, \
28 K10, K11, K12, K13, \
29 K20, K21, K22, K23, \
30 K30, K31, K32, K33 \
31) \
32{ \
33 { K00, K01, K02, K03 }, \
34 { K10, K11, K12, K13 }, \
35 { K20, K21, K22, K23 }, \
36 { K30, K31, K32, K33 }, \
37}
diff --git a/keyboards/rart/rart4x4/readme.md b/keyboards/rart/rart4x4/readme.md
new file mode 100644
index 000000000..4908f2667
--- /dev/null
+++ b/keyboards/rart/rart4x4/readme.md
@@ -0,0 +1,14 @@
1# [RART4X4](https://github.com/alabahuy/RART/blob/master/RART4X4/readme.md)
2
3![rartpad](https://user-images.githubusercontent.com/30220306/100748142-8aa5a080-3415-11eb-9b22-77f38d4dd891.png)
44x4 Macropad pcb with double encoder, based on IMKG (Indonesia Mechanical Keyboard Group)
5
6* Keyboard Maintainer: [Alabahuy](https://github.com/alabahuy)
7* Hardware Supported: RART4X4 PCB, Promicro, Mini USB, Encoders
8* Hardware Availability: Private GB
9
10Make example for this keyboard (after setting up your build environment):
11
12 make rart/rart4x4:default
13
14See 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/rart/rart4x4/rules.mk b/keyboards/rart/rart4x4/rules.mk
new file mode 100644
index 000000000..773b58600
--- /dev/null
+++ b/keyboards/rart/rart4x4/rules.mk
@@ -0,0 +1,25 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5BOOTLOADER = caterina
6
7# Build Options
8# change yes to no to disable
9#
10BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
11MOUSEKEY_ENABLE = yes # Mouse keys
12EXTRAKEY_ENABLE = yes # Audio control and System control
13CONSOLE_ENABLE = no # Console for debug
14COMMAND_ENABLE = no # Commands for debug and configuration
15# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
16SLEEP_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
18NKRO_ENABLE = yes # USB Nkey Rollover
19BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
20RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
21BLUETOOTH_ENABLE = no # Enable Bluetooth
22AUDIO_ENABLE = no # Audio output
23ENCODER_ENABLE = yes
24
25LAYOUTS = ortho_4x4