summaryrefslogtreecommitdiff
path: root/keyboards/rookiebwoy/neopad/rev1
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/rookiebwoy/neopad/rev1')
-rwxr-xr-xkeyboards/rookiebwoy/neopad/rev1/config.h21
-rwxr-xr-xkeyboards/rookiebwoy/neopad/rev1/info.json40
-rwxr-xr-xkeyboards/rookiebwoy/neopad/rev1/keymaps/default/keymap.c154
-rw-r--r--keyboards/rookiebwoy/neopad/rev1/readme.md5
-rwxr-xr-xkeyboards/rookiebwoy/neopad/rev1/rev1.c65
-rwxr-xr-xkeyboards/rookiebwoy/neopad/rev1/rules.mk15
6 files changed, 300 insertions, 0 deletions
diff --git a/keyboards/rookiebwoy/neopad/rev1/config.h b/keyboards/rookiebwoy/neopad/rev1/config.h
new file mode 100755
index 0000000000..fd1724caf1
--- /dev/null
+++ b/keyboards/rookiebwoy/neopad/rev1/config.h
@@ -0,0 +1,21 @@
+/*
+Copyright 2021 rookiebwoy
+
+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
+
+/* Onboard LEDs */
+#define LED_00 F6
+#define LED_01 F7
diff --git a/keyboards/rookiebwoy/neopad/rev1/info.json b/keyboards/rookiebwoy/neopad/rev1/info.json
new file mode 100755
index 0000000000..0a0340c06d
--- /dev/null
+++ b/keyboards/rookiebwoy/neopad/rev1/info.json
@@ -0,0 +1,40 @@
+{
+ "keyboard_name": "neopad",
+ "manufacturer": "rookiebwoy",
+ "url": "https://github.com/rookiebwoy/neopad)",
+ "maintainer": "rookiebwoy",
+ "usb": {
+ "vid": "0xFEED",
+ "pid": "0x0913",
+ "device_version": "0.1.0"
+ },
+ "matrix_pins": {
+ "cols": ["B3", "B2", "B6"],
+ "rows": ["F4", "F5"]
+ },
+ "diode_direction": "COL2ROW",
+ "encoder": {
+ "rotary": [
+ {"pin_a": "D1", "pin_b": "D0"},
+ {"pin_a": "D4", "pin_b": "C6"}
+ ]
+ },
+ "processor": "atmega32u4",
+ "bootloader": "caterina",
+ "tapping": {
+ "toggle": 2
+ },
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ {"matrix": [0, 0], "x": 0, "y": 0},
+ {"matrix": [0, 1], "x": 1, "y": 0},
+ {"matrix": [0, 2], "x": 2, "y": 0},
+
+ {"matrix": [1, 0], "x": 0, "y": 1},
+ {"matrix": [1, 1], "x": 1, "y": 1},
+ {"matrix": [1, 2], "x": 2, "y": 1}
+ ]
+ }
+ }
+}
diff --git a/keyboards/rookiebwoy/neopad/rev1/keymaps/default/keymap.c b/keyboards/rookiebwoy/neopad/rev1/keymaps/default/keymap.c
new file mode 100755
index 0000000000..08227c84f9
--- /dev/null
+++ b/keyboards/rookiebwoy/neopad/rev1/keymaps/default/keymap.c
@@ -0,0 +1,154 @@
+/* Copyright 2021 rookiebwoy
+ *
+ * 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
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /*
+ LAYER 0 - MUSIC
+ /-----------------------------`
+ | TO(1) | stop | mute | L ENC: prev/next song
+ |---------|---------|---------|
+ | prev | play | next | R ENC: vol up/down
+ \-----------------------------'
+ */
+ [0] = LAYOUT(
+ TO(1), KC_MSTP, KC_MUTE,
+ KC_MPRV, KC_MPLY, KC_MNXT
+ ),
+
+ /*
+ LAYER 1 - MOVEMENT IN WINDOWS
+ /---------------------------------------`
+ | TO(2) | maximize | show desktop | L ENC: change desktop
+ |-------------|----------|--------------|
+ | move window | minimize | move window | R ENC: change browser tab + change explorer window
+ \---------------------------------------'
+ */
+ [1] = LAYOUT(
+ TO(2), LGUI(KC_UP), LGUI(KC_D),
+ LGUI(KC_LEFT), LGUI(KC_DOWN), LGUI(KC_RIGHT)
+ ),
+
+ /*
+ LAYER 2 - SHORTCUT
+ /------------------------------`
+ | TO(3) | esc | task man | L ENC: redo/undo
+ |---------|---------|----------|
+ | cut | copy | paste | R ENC: mouse wheel up/down
+ \------------------------------'
+ */
+ [2] = LAYOUT(
+ TO(3), KC_ESC, LCTL(LSFT(KC_ESC)),
+ LCTL(KC_X), LCTL(KC_C), LCTL(KC_V)
+ ),
+
+ /*
+ LAYER 3 - AUDACITY
+ /-----------------------------`
+ | TO(0) | REC | canc | L ENC: pan right/left
+ |---------|---------|---------|
+ | ctrl | play | pause | R ENC: mouse wheel up/down
+ \-----------------------------'
+ */
+ [3] = LAYOUT(
+ TO(0), LSFT(KC_R), KC_DEL,
+ KC_LCTL, KC_SPC, KC_P
+ ),
+
+};
+
+
+bool encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) { /* LEFT ENCODER */
+ switch (get_highest_layer(layer_state)) {
+ case 0:
+ // layer 0 - next song (CW) and previous (CCW)
+ if (clockwise) {
+ tap_code(KC_MNXT);
+ } else {
+ tap_code(KC_MPRV);
+ }
+ break;
+
+ case 1:
+ // layer 1 - change desktop right (CW) and left (CCW)
+ if (clockwise) {
+ tap_code16(LCTL(LGUI(KC_RIGHT)));
+ } else {
+ tap_code16(LCTL(LGUI(KC_LEFT)));
+ }
+ break;
+
+ case 2:
+ // layer 2 - redo (CW) and undo (CCW)
+ if (clockwise) {
+ tap_code16(LCTL(KC_Y));
+ } else {
+ tap_code16(LCTL(KC_Z));
+ }
+ break;
+
+ case 3:
+ // layer 3 - pan right (CW) and left (CCW)
+ if (clockwise) {
+ tap_code(KC_WH_R);
+ } else {
+ tap_code(KC_WH_L);
+ }
+ break;
+ }
+
+ } else if (index == 1) { /* RIGHT ENCODER */
+ switch (get_highest_layer(layer_state)) {
+ case 0:
+ // layer 0 - volume up (CW) and down (CCW)
+ if (clockwise) {
+ tap_code(KC_VOLU);
+ } else {
+ tap_code(KC_VOLD);
+ }
+ break;
+
+ case 1:
+ // layer 1 - change browser tab (CW) and change explorer window (CCW)
+ if (clockwise) {
+ tap_code16(LCTL(KC_TAB));
+ } else {
+ tap_code16(LALT(LSFT(KC_TAB)));
+ }
+ break;
+
+ case 2:
+ // layer 2 - wheel up (CW) and down (CCW)
+ if (clockwise) {
+ tap_code(KC_WH_U);
+ } else {
+ tap_code(KC_WH_D);
+ }
+ break;
+
+ case 3:
+ // layer 3 - wheel up (CW) and down (CCW)
+ if (clockwise) {
+ tap_code(KC_WH_U);
+ } else {
+ tap_code(KC_WH_D);
+ }
+ break;
+ }
+ }
+ return true;
+}
diff --git a/keyboards/rookiebwoy/neopad/rev1/readme.md b/keyboards/rookiebwoy/neopad/rev1/readme.md
new file mode 100644
index 0000000000..1265922722
--- /dev/null
+++ b/keyboards/rookiebwoy/neopad/rev1/readme.md
@@ -0,0 +1,5 @@
+# Neopad rev1
+
+Final revision of the Neopad macropad. For in depth look please go to [project repository](https://github.com/rookiebwoy/neopad).
+
+
diff --git a/keyboards/rookiebwoy/neopad/rev1/rev1.c b/keyboards/rookiebwoy/neopad/rev1/rev1.c
new file mode 100755
index 0000000000..c8216f4e70
--- /dev/null
+++ b/keyboards/rookiebwoy/neopad/rev1/rev1.c
@@ -0,0 +1,65 @@
+/* Copyright 2021 rookiebwoy
+ *
+ * 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 "quantum.h"
+
+void keyboard_pre_init_kb(void) {
+ // Set LED IO as outputs
+ setPinOutput(LED_00);
+ setPinOutput(LED_01);
+ keyboard_pre_init_user();
+}
+
+bool shutdown_kb(bool jump_to_bootloader) {
+ if (!shutdown_user(jump_to_bootloader)) {
+ return false;
+ }
+ // Shutdown LEDs
+ writePinLow(LED_00);
+ writePinLow(LED_01);
+ return true;
+}
+
+layer_state_t layer_state_set_kb(layer_state_t state) {
+ state = layer_state_set_user(state);
+
+ // Layer LEDs act as binary indication of current layer
+ uint8_t layer = get_highest_layer(state);
+ writePin(LED_00, layer & 0b1);
+ writePin(LED_01, (layer >> 1) & 0b1);
+ return state;
+}
+
+// Optional override functions below.
+// You can leave any or all of these undefined.
+// These are only required if you want to perform custom actions.
+
+void matrix_init_kb(void) {
+ // put your keyboard start-up code here
+ // runs once when the firmware starts up
+ uint8_t led_delay_ms = 80;
+ for (int i = 0; i < 2; i++) {
+ writePinHigh(LED_00);
+ writePinHigh(LED_01);
+ wait_ms(led_delay_ms);
+ writePinLow(LED_00);
+ writePinLow(LED_01);
+ if (i < 1) {
+ wait_ms(led_delay_ms);
+ }
+ }
+
+ matrix_init_user();
+}
diff --git a/keyboards/rookiebwoy/neopad/rev1/rules.mk b/keyboards/rookiebwoy/neopad/rev1/rules.mk
new file mode 100755
index 0000000000..7816aab001
--- /dev/null
+++ b/keyboards/rookiebwoy/neopad/rev1/rules.mk
@@ -0,0 +1,15 @@
+# Build Options
+# change yes to no to disable
+#
+BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
+MOUSEKEY_ENABLE = yes # Mouse keys
+EXTRAKEY_ENABLE = yes # Audio control and System control
+CONSOLE_ENABLE = yes # Console for debug
+COMMAND_ENABLE = no # Commands for debug and configuration
+NKRO_ENABLE = no # Enable N-Key Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
+AUDIO_ENABLE = no # Audio output
+
+ENCODER_ENABLE = yes
+KEY_LOCK_ENABLE = yes