diff options
-rw-r--r-- | keyboards/rart/rartpad/config.h | 65 | ||||
-rw-r--r-- | keyboards/rart/rartpad/info.json | 62 | ||||
-rw-r--r-- | keyboards/rart/rartpad/keymaps/default/keymap.c | 54 | ||||
-rw-r--r-- | keyboards/rart/rartpad/keymaps/numpad/keymap.c | 45 | ||||
-rw-r--r-- | keyboards/rart/rartpad/rartpad.c | 22 | ||||
-rw-r--r-- | keyboards/rart/rartpad/rartpad.h | 41 | ||||
-rw-r--r-- | keyboards/rart/rartpad/readme.md | 14 | ||||
-rw-r--r-- | keyboards/rart/rartpad/rules.mk | 29 |
8 files changed, 332 insertions, 0 deletions
diff --git a/keyboards/rart/rartpad/config.h b/keyboards/rart/rartpad/config.h new file mode 100644 index 000000000..dfbefec19 --- /dev/null +++ b/keyboards/rart/rartpad/config.h | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | Copyright 2020 Alabahuy | ||
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 0x414C // "AL" | ||
24 | #define PRODUCT_ID 0x0050 // "P" | ||
25 | #define DEVICE_VER 0x0001 | ||
26 | #define MANUFACTURER Alabahuy | ||
27 | #define PRODUCT RARTPAD | ||
28 | #define DESCRIPTION 5x4 Macropad | ||
29 | |||
30 | /* key matrix size */ | ||
31 | #define MATRIX_ROWS 5 | ||
32 | #define MATRIX_COLS 4 | ||
33 | |||
34 | /* key matrix pins */ | ||
35 | #define MATRIX_ROW_PINS { B6, F6, D0, D4, C6 } | ||
36 | #define MATRIX_COL_PINS { B2, D1, D2, D3 } | ||
37 | #define UNUSED_PINS | ||
38 | |||
39 | /* COL2ROW or ROW2COL */ | ||
40 | #define DIODE_DIRECTION COL2ROW | ||
41 | |||
42 | #define NUM_LOCK_LED_PIN D7 | ||
43 | |||
44 | /* Set 0 if debouncing isn't needed */ | ||
45 | #define DEBOUNCE 5 | ||
46 | |||
47 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
48 | #define LOCKING_SUPPORT_ENABLE | ||
49 | |||
50 | /* Locking resynchronize hack */ | ||
51 | #define LOCKING_RESYNC_ENABLE | ||
52 | |||
53 | #define ENCODERS_PAD_A { B3, F5 } | ||
54 | #define ENCODERS_PAD_B { B1, F4 } | ||
55 | |||
56 | #define RGB_DI_PIN F7 | ||
57 | #ifdef RGB_DI_PIN | ||
58 | #define RGBLIGHT_ANIMATIONS | ||
59 | #define RGBLED_NUM 5 | ||
60 | #define RGBLIGHT_HUE_STEP 8 | ||
61 | #define RGBLIGHT_SAT_STEP 8 | ||
62 | #define RGBLIGHT_VAL_STEP 8 | ||
63 | #define RGBLIGHT_LIMIT_VAL 240 | ||
64 | #define RGBLIGHT_SLEEP | ||
65 | #endif | ||
diff --git a/keyboards/rart/rartpad/info.json b/keyboards/rart/rartpad/info.json new file mode 100644 index 000000000..8ec37ece0 --- /dev/null +++ b/keyboards/rart/rartpad/info.json | |||
@@ -0,0 +1,62 @@ | |||
1 | { | ||
2 | "keyboard_name": "RARTPAD", | ||
3 | "url": "", | ||
4 | "maintainer": "Alabahuy", | ||
5 | "width": 5, | ||
6 | "height": 4, | ||
7 | "layouts": { | ||
8 | "LAYOUT_ortho_5x4": { | ||
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 | {"label": "0", "x": 0, "y": 4}, | ||
31 | {"label": "00", "x": 1, "y": 4}, | ||
32 | {"label": ".", "x": 2, "y": 4}, | ||
33 | {"label": "Enter", "x": 3, "y": 4} | ||
34 | ] | ||
35 | }, | ||
36 | "LAYOUT_numpad_5x4": { | ||
37 | "layout": [ | ||
38 | {"label": "Numlock", "x": 0, "y": 0}, | ||
39 | {"label": "/", "x": 1, "y": 0}, | ||
40 | {"label": "*", "x": 2, "y": 0}, | ||
41 | {"label": "-", "x": 3, "y": 0}, | ||
42 | |||
43 | {"label": "7", "x": 0, "y": 1}, | ||
44 | {"label": "8", "x": 1, "y": 1}, | ||
45 | {"label": "9", "x": 2, "y": 1}, | ||
46 | |||
47 | {"label": "4", "x": 0, "y": 2}, | ||
48 | {"label": "5", "x": 1, "y": 2}, | ||
49 | {"label": "6", "x": 2, "y": 2}, | ||
50 | {"label": "+", "x": 3, "y": 1, "h": 2}, | ||
51 | |||
52 | {"label": "1", "x": 0, "y": 3}, | ||
53 | {"label": "2", "x": 1, "y": 3}, | ||
54 | {"label": "3", "x": 2, "y": 3}, | ||
55 | |||
56 | {"label": "0", "x": 0, "y": 4, "w": 2}, | ||
57 | {"label": ".", "x": 2, "y": 4}, | ||
58 | {"label": "Enter", "x": 3, "y": 3, "h": 2} | ||
59 | ] | ||
60 | } | ||
61 | } | ||
62 | } | ||
diff --git a/keyboards/rart/rartpad/keymaps/default/keymap.c b/keyboards/rart/rartpad/keymaps/default/keymap.c new file mode 100644 index 000000000..0d7b6686a --- /dev/null +++ b/keyboards/rart/rartpad/keymaps/default/keymap.c | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | Copyright 2020 Alabahuy | ||
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 | #include QMK_KEYBOARD_H | ||
18 | |||
19 | |||
20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
21 | |||
22 | [0] = LAYOUT_ortho_5x4( | ||
23 | KC_NLCK, KC_PSLS, KC_PAST, KC_INS, | ||
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_PMNS, | ||
27 | MO(1), KC_P0, KC_PDOT, KC_PENT | ||
28 | ), | ||
29 | |||
30 | [1] = LAYOUT_ortho_5x4( | ||
31 | KC_TRNS, RGB_HUI, RGB_HUD, KC_TRNS, | ||
32 | RGB_SAI, RGB_SAD, KC_MNXT, KC_MPRV, | ||
33 | RGB_VAI, RGB_VAD, KC_MSTP, KC_MPLY, | ||
34 | KC_COPY, KC_PSTE, KC_MYCM, KC_CALC, | ||
35 | KC_TRNS, RGB_TOG, KC_TRNS, KC_TRNS | ||
36 | ) | ||
37 | }; | ||
38 | |||
39 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
40 | if (index == 0) { /* First encoder */ | ||
41 | if (clockwise) { | ||
42 | tap_code(KC_VOLU); | ||
43 | } else { | ||
44 | tap_code(KC_VOLD); | ||
45 | } | ||
46 | } else if (index == 1) { /* Second encoder */ | ||
47 | if (clockwise) { | ||
48 | tap_code(KC_WH_D); | ||
49 | } else { | ||
50 | tap_code(KC_WH_U); | ||
51 | } | ||
52 | } | ||
53 | } | ||
54 | |||
diff --git a/keyboards/rart/rartpad/keymaps/numpad/keymap.c b/keyboards/rart/rartpad/keymaps/numpad/keymap.c new file mode 100644 index 000000000..a3508ece9 --- /dev/null +++ b/keyboards/rart/rartpad/keymaps/numpad/keymap.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | Copyright 2020 Alabahuy | ||
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 | #include QMK_KEYBOARD_H | ||
18 | |||
19 | |||
20 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
21 | |||
22 | [0] = LAYOUT_numpad_5x4( | ||
23 | KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, | ||
24 | KC_P7, KC_P8, KC_P9, | ||
25 | KC_P4, KC_P5, KC_P6, KC_PPLS, | ||
26 | KC_P1, KC_P2, KC_P3, | ||
27 | KC_P0, KC_PDOT, KC_PENT | ||
28 | ) | ||
29 | }; | ||
30 | |||
31 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
32 | if (index == 0) { /* First encoder */ | ||
33 | if (clockwise) { | ||
34 | tap_code(KC_VOLU); | ||
35 | } else { | ||
36 | tap_code(KC_VOLD); | ||
37 | } | ||
38 | } else if (index == 1) { /* Second encoder */ | ||
39 | if (clockwise) { | ||
40 | tap_code(KC_PGUP); | ||
41 | } else { | ||
42 | tap_code(KC_PGDN); | ||
43 | } | ||
44 | } | ||
45 | } | ||
diff --git a/keyboards/rart/rartpad/rartpad.c b/keyboards/rart/rartpad/rartpad.c new file mode 100644 index 000000000..566c3fa46 --- /dev/null +++ b/keyboards/rart/rartpad/rartpad.c | |||
@@ -0,0 +1,22 @@ | |||
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 "rartpad.h" | ||
16 | |||
17 | bool led_update_kb(led_t led_state) { | ||
18 | if (led_update_user(led_state)) { | ||
19 | writePin(NUM_LOCK_LED_PIN, led_state.num_lock); | ||
20 | } | ||
21 | return true; | ||
22 | } | ||
diff --git a/keyboards/rart/rartpad/rartpad.h b/keyboards/rart/rartpad/rartpad.h new file mode 100644 index 000000000..2e516e2cf --- /dev/null +++ b/keyboards/rart/rartpad/rartpad.h | |||
@@ -0,0 +1,41 @@ | |||
1 | |||
2 | #pragma once | ||
3 | |||
4 | #include "quantum.h" | ||
5 | |||
6 | /* This a shortcut to help you visually see your layout. | ||
7 | * | ||
8 | * The first section contains all of the arguments representing the physical | ||
9 | * layout of the board and position of the keys. | ||
10 | * | ||
11 | * The second converts the arguments into a two-dimensional array which | ||
12 | * represents the switch matrix. | ||
13 | */ | ||
14 | #define LAYOUT_ortho_5x4( \ | ||
15 | K00, K01, K02, K03, \ | ||
16 | K10, K11, K12, K13, \ | ||
17 | K20, K21, K22, K23, \ | ||
18 | K30, K31, K32, K33, \ | ||
19 | K40, K41, K42, K43 \ | ||
20 | ) \ | ||
21 | { \ | ||
22 | { K00, K01, K02, K03 }, \ | ||
23 | { K10, K11, K12, K13 }, \ | ||
24 | { K20, K21, K22, K23 }, \ | ||
25 | { K30, K31, K32, K33 }, \ | ||
26 | { K40, K41, K42, K43 }, \ | ||
27 | } | ||
28 | #define LAYOUT_numpad_5x4( \ | ||
29 | K00, K01, K02, K03, \ | ||
30 | K10, K11, K12, \ | ||
31 | K20, K21, K22, K13, \ | ||
32 | K30, K31, K32, \ | ||
33 | K40, K42, K33 \ | ||
34 | ) \ | ||
35 | { \ | ||
36 | { K00, K01, K02, K03 }, \ | ||
37 | { K10, K11, K12, K13 }, \ | ||
38 | { K20, K21, K22, KC_NO }, \ | ||
39 | { K30, K31, K32, K33 }, \ | ||
40 | { K40, KC_NO, K42, KC_NO }, \ | ||
41 | } | ||
diff --git a/keyboards/rart/rartpad/readme.md b/keyboards/rart/rartpad/readme.md new file mode 100644 index 000000000..3f730c59d --- /dev/null +++ b/keyboards/rart/rartpad/readme.md | |||
@@ -0,0 +1,14 @@ | |||
1 | # [RARTPAD](https://github.com/alabahuy/RART/tree/master/RARTPAD) | ||
2 | |||
3 |  | ||
4 | 5x4 Macropad pcb with double encoder, based on IMKG (Indonesia Mechanical Keyboard Group) | ||
5 | |||
6 | * Keyboard Maintainer: [Alabahuy](https://github.com/alabahuy) | ||
7 | * Hardware Supported: RARTPAD PCB, Promicro, Mini USB, Encoders | ||
8 | * Hardware Availability: Private GB | ||
9 | |||
10 | Make example for this keyboard (after setting up your build environment): | ||
11 | |||
12 | make rart/rartpad:default | ||
13 | |||
14 | 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). | ||
diff --git a/keyboards/rart/rartpad/rules.mk b/keyboards/rart/rartpad/rules.mk new file mode 100644 index 000000000..c05f7eb06 --- /dev/null +++ b/keyboards/rart/rartpad/rules.mk | |||
@@ -0,0 +1,29 @@ | |||
1 | # MCU name | ||
2 | MCU = atmega32u4 | ||
3 | |||
4 | # Bootloader selection | ||
5 | # Teensy halfkay | ||
6 | # Pro Micro caterina | ||
7 | # Atmel DFU atmel-dfu | ||
8 | # LUFA DFU lufa-dfu | ||
9 | # QMK DFU qmk-dfu | ||
10 | # ATmega32A bootloadHID | ||
11 | # ATmega328P USBasp | ||
12 | BOOTLOADER = caterina | ||
13 | |||
14 | # Build Options | ||
15 | # comment out to disable the options. | ||
16 | # | ||
17 | BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration | ||
18 | MOUSEKEY_ENABLE = yes # Mouse keys | ||
19 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
20 | CONSOLE_ENABLE = no # Console for debug | ||
21 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
22 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
23 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
24 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
25 | AUDIO_ENABLE = no | ||
26 | RGBLIGHT_ENABLE = yes | ||
27 | ENCODER_ENABLE = yes | ||
28 | |||
29 | LAYOUTS = ortho_5x4 numpad_5x4 | ||