From 977f667da93754a4471423f321dfeb7389269445 Mon Sep 17 00:00:00 2001
From: zlabkeeb <160311066+zlabkeeb@users.noreply.github.com>
Date: Thu, 21 Mar 2024 03:32:04 +0700
Subject: [PATCH] Add Macropad 6Pad (#23099)
---
keyboards/zlabkeeb/6pad/info.json | 65 +++++++++++++++++++
.../zlabkeeb/6pad/keymaps/default/keymap.c | 50 ++++++++++++++
.../zlabkeeb/6pad/keymaps/default/rules.mk | 1 +
keyboards/zlabkeeb/6pad/keymaps/via/keymap.c | 38 +++++++++++
keyboards/zlabkeeb/6pad/keymaps/via/rules.mk | 2 +
keyboards/zlabkeeb/6pad/readme.md | 26 ++++++++
keyboards/zlabkeeb/6pad/rules.mk | 1 +
7 files changed, 183 insertions(+)
create mode 100644 keyboards/zlabkeeb/6pad/info.json
create mode 100644 keyboards/zlabkeeb/6pad/keymaps/default/keymap.c
create mode 100644 keyboards/zlabkeeb/6pad/keymaps/default/rules.mk
create mode 100644 keyboards/zlabkeeb/6pad/keymaps/via/keymap.c
create mode 100644 keyboards/zlabkeeb/6pad/keymaps/via/rules.mk
create mode 100644 keyboards/zlabkeeb/6pad/readme.md
create mode 100644 keyboards/zlabkeeb/6pad/rules.mk
diff --git a/keyboards/zlabkeeb/6pad/info.json b/keyboards/zlabkeeb/6pad/info.json
new file mode 100644
index 000000000000..cd37d4ca023b
--- /dev/null
+++ b/keyboards/zlabkeeb/6pad/info.json
@@ -0,0 +1,65 @@
+{
+ "keyboard_name": "ZLABKEEB 6PAD",
+ "manufacturer": "zlabkeeb",
+ "maintainer": "zlabkeeb",
+ "development_board": "promicro",
+ "features": {
+ "bootmagic": true,
+ "extrakey": true,
+ "encoder": true,
+ "mousekey": true,
+ "rgblight": true
+ },
+ "build": {
+ "lto": true
+ },
+ "url": "https://github.com/zlabkeeb",
+ "usb": {
+ "device_version": "1.0.0",
+ "vid": "0x4154",
+ "pid": "0x7A77"
+ },
+ "rgblight": {
+ "animations": {
+ "alternating": true,
+ "breathing": true,
+ "christmas": true,
+ "knight": true,
+ "rainbow_mood": true,
+ "rainbow_swirl": true,
+ "snake": true,
+ "static_gradient": true,
+ "twinkle": true
+ },
+ "led_count": 4,
+ "max_brightness": 180,
+ "saturation_steps": 8,
+ "sleep": true
+ },
+ "ws2812": {
+ "pin": "B6"
+ },
+ "encoder": {
+ "rotary": [
+ {"pin_a": "B4", "pin_b": "B5"}
+ ]
+ },
+ "matrix_pins": {
+ "direct": [
+ ["D1", "D0", "D4"],
+ ["C6", "D7", "E6"]
+ ]
+ },
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ {"x": 0, "y": 0, "matrix": [0, 0]},
+ {"x": 1, "y": 0, "matrix": [0, 1]},
+ {"x": 2, "y": 0, "matrix": [0, 2]},
+ {"x": 0, "y": 1, "matrix": [1, 0]},
+ {"x": 1, "y": 1, "matrix": [1, 1]},
+ {"x": 2, "y": 1, "matrix": [1, 2]}
+ ]
+ }
+ }
+}
diff --git a/keyboards/zlabkeeb/6pad/keymaps/default/keymap.c b/keyboards/zlabkeeb/6pad/keymaps/default/keymap.c
new file mode 100644
index 000000000000..d0048cd88dfb
--- /dev/null
+++ b/keyboards/zlabkeeb/6pad/keymaps/default/keymap.c
@@ -0,0 +1,50 @@
+/*
+Copyright 2024 zlabkeeb (zlabkeeb@gmail.com)
+
+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 .
+*/
+
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /*
+ * ┌─────────┌─────────┌─────────┐
+ * │ 1 │ layer 1 │ 3 │
+ * ├─────────┼─────────┼─────────|
+ * │ 4 │ 5 │ 6 |
+ * ├─────────┼─────────┼─────────┘
+ */
+ [0] = LAYOUT(
+ KC_1, TO(1), KC_2,
+ KC_3, KC_4, KC_5
+ ),
+ /*
+ * ┌─────────┌─────────┌─────────┐
+ * │ A │ layer O │ B │
+ * ├─────────┼─────────┼─────────|
+ * │ C │ D │ E |
+ * ├─────────┼─────────┼─────────┘
+ */
+ [1] = LAYOUT(
+ KC_A, TO(0), KC_B,
+ KC_C, KC_D, KC_E
+ )
+};
+
+#if defined (ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
+ [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
+ [1] = { ENCODER_CCW_CW(KC_PGDN, KC_PGUP)}
+};
+#endif
diff --git a/keyboards/zlabkeeb/6pad/keymaps/default/rules.mk b/keyboards/zlabkeeb/6pad/keymaps/default/rules.mk
new file mode 100644
index 000000000000..ee325681483f
--- /dev/null
+++ b/keyboards/zlabkeeb/6pad/keymaps/default/rules.mk
@@ -0,0 +1 @@
+ENCODER_MAP_ENABLE = yes
diff --git a/keyboards/zlabkeeb/6pad/keymaps/via/keymap.c b/keyboards/zlabkeeb/6pad/keymaps/via/keymap.c
new file mode 100644
index 000000000000..d958bfb5bdf4
--- /dev/null
+++ b/keyboards/zlabkeeb/6pad/keymaps/via/keymap.c
@@ -0,0 +1,38 @@
+/*
+Copyright 2024 zlabkeeb (zlabkeeb@gmail.com)
+
+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 .
+*/
+
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /*
+ * ┌─────────┌─────────┌─────────┐
+ * │ 1 │ 2 │ 3 │
+ * ├─────────┼─────────┼─────────|
+ * │ 4 │ 5 │ 6 |
+ * ├─────────┼─────────┼─────────┘
+ */
+ [0] = LAYOUT(
+ KC_1, KC_2, KC_3,
+ KC_4, KC_5, KC_6
+ )
+};
+
+#if defined (ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
+ [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU)}
+};
+#endif
diff --git a/keyboards/zlabkeeb/6pad/keymaps/via/rules.mk b/keyboards/zlabkeeb/6pad/keymaps/via/rules.mk
new file mode 100644
index 000000000000..f1adcab005e8
--- /dev/null
+++ b/keyboards/zlabkeeb/6pad/keymaps/via/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+ENCODER_MAP_ENABLE = yes
diff --git a/keyboards/zlabkeeb/6pad/readme.md b/keyboards/zlabkeeb/6pad/readme.md
new file mode 100644
index 000000000000..9470ee1d6d9e
--- /dev/null
+++ b/keyboards/zlabkeeb/6pad/readme.md
@@ -0,0 +1,26 @@
+# 6PAD
+
+![6PAD](https://i.imgur.com/yt3dKCBh.jpeg)
+
+6PAD is a Simple Yet Elegant Macropad, 5 Keys & Single Rotary Encoder, Designed And Manufactured In INDONESIA.
+
+- Support RGB light UnderGlow
+- Keyboard Maintainer: [zlabkeeb](https://github.com/zlabkeeb)
+- Hardware Supported: 6Pad PCB, Promicro
+- Hardware Availability: (INDONESIA Only) Will be available at [Tokopedia](https://www.tokopedia.com/zahranetid)
+
+Make example for this keyboard (after setting up your build environment):
+
+ make zlabkeeb/6pad:default
+
+Flashing example for this keyboard:
+
+ make zlabkeeb/6pad: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 1 way:
+
+- **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
diff --git a/keyboards/zlabkeeb/6pad/rules.mk b/keyboards/zlabkeeb/6pad/rules.mk
new file mode 100644
index 000000000000..6e7633bfe015
--- /dev/null
+++ b/keyboards/zlabkeeb/6pad/rules.mk
@@ -0,0 +1 @@
+# This file intentionally left blank