From 5fde2d730c854eb6516771f1c5dcd22626f85efb Mon Sep 17 00:00:00 2001 From: David Doan Date: Mon, 28 Dec 2020 12:27:00 -0800 Subject: [PATCH] 1x4p1 (#11186) Co-authored-by: Drashna Jaelre Co-authored-by: Ryan Co-authored-by: Erovia --- keyboards/arrayperipherals/1x4p1/1x4p1.c | 18 ++++++++ keyboards/arrayperipherals/1x4p1/1x4p1.h | 26 +++++++++++ keyboards/arrayperipherals/1x4p1/config.h | 41 +++++++++++++++++ keyboards/arrayperipherals/1x4p1/info.json | 18 ++++++++ .../1x4p1/keymaps/default/keymap.c | 39 ++++++++++++++++ .../1x4p1/keymaps/default/readme.md | 5 +++ .../1x4p1/keymaps/via/keymap.c | 45 +++++++++++++++++++ .../1x4p1/keymaps/via/rules.mk | 1 + keyboards/arrayperipherals/1x4p1/readme.md | 16 +++++++ keyboards/arrayperipherals/1x4p1/rules.mk | 24 ++++++++++ keyboards/arrayperipherals/readme.md | 5 +++ 11 files changed, 238 insertions(+) create mode 100644 keyboards/arrayperipherals/1x4p1/1x4p1.c create mode 100644 keyboards/arrayperipherals/1x4p1/1x4p1.h create mode 100644 keyboards/arrayperipherals/1x4p1/config.h create mode 100644 keyboards/arrayperipherals/1x4p1/info.json create mode 100644 keyboards/arrayperipherals/1x4p1/keymaps/default/keymap.c create mode 100644 keyboards/arrayperipherals/1x4p1/keymaps/default/readme.md create mode 100644 keyboards/arrayperipherals/1x4p1/keymaps/via/keymap.c create mode 100644 keyboards/arrayperipherals/1x4p1/keymaps/via/rules.mk create mode 100644 keyboards/arrayperipherals/1x4p1/readme.md create mode 100644 keyboards/arrayperipherals/1x4p1/rules.mk create mode 100644 keyboards/arrayperipherals/readme.md diff --git a/keyboards/arrayperipherals/1x4p1/1x4p1.c b/keyboards/arrayperipherals/1x4p1/1x4p1.c new file mode 100644 index 00000000000..788ccff553a --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/1x4p1.c @@ -0,0 +1,18 @@ +/* +Copyright 2020 David Doan + +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 "1x4p1.h" diff --git a/keyboards/arrayperipherals/1x4p1/1x4p1.h b/keyboards/arrayperipherals/1x4p1/1x4p1.h new file mode 100644 index 00000000000..8f385a9086f --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/1x4p1.h @@ -0,0 +1,26 @@ +/* +Copyright 2020 David Doan + +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 . +*/ + +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_1x5( \ + k01, k02, k03, k04, k05\ + ) { \ + { k01, k02, k03, k04, k05} \ +} diff --git a/keyboards/arrayperipherals/1x4p1/config.h b/keyboards/arrayperipherals/1x4p1/config.h new file mode 100644 index 00000000000..44559be3ed1 --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/config.h @@ -0,0 +1,41 @@ +/* +Copyright 2020 David Doan + +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 . +*/ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4152 // "AR" +#define PRODUCT_ID 0x4F46 // "OF" +#define DEVICE_VER 0x0001 +#define MANUFACTURER Array Peripherals +#define PRODUCT [1x4] + 1 Macropad + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 5 + + +#define DIRECT_PINS { \ + { C7, B7, D6, F5, F7} \ +} +#define UNUSED_PINS + +/* rotary encoder*/ +#define ENCODERS_PAD_A {F0} +#define ENCODERS_PAD_B {F1} diff --git a/keyboards/arrayperipherals/1x4p1/info.json b/keyboards/arrayperipherals/1x4p1/info.json new file mode 100644 index 00000000000..3edf84ab0d7 --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "[1 x 4] + 1 Macropad", + "url": "https://github.com/daviddoan", + "maintainer": "David Doan", + "width": 5, + "height": 1, + "layouts": { + "LAYOUT_ortho_1x5": { + "layout": [ + {"label": "K01", "x":0, "y":0}, + {"label": "K02", "x":1, "y":0}, + {"label": "K03", "x":2, "y":0}, + {"label": "K04", "x":3, "y":0}, + {"label": "K05", "x":4, "y":0} + ] + } + } +} diff --git a/keyboards/arrayperipherals/1x4p1/keymaps/default/keymap.c b/keyboards/arrayperipherals/1x4p1/keymaps/default/keymap.c new file mode 100644 index 00000000000..cf4433d8c83 --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* +Copyright 2020 David Doan + +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 + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_MS_WH_UP); + } else { + tap_code(KC_MS_WH_DOWN); + } + } +} + +// +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //button closest to usb is first + [0] = LAYOUT_ortho_1x5( + KC_ESC, KC_TAB, KC_LSHIFT, KC_LCTRL, TG(1) + ), + + [1] = LAYOUT_ortho_1x5( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(0) + ) +}; diff --git a/keyboards/arrayperipherals/1x4p1/keymaps/default/readme.md b/keyboards/arrayperipherals/1x4p1/keymaps/default/readme.md new file mode 100644 index 00000000000..ba50c6bd2eb --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/keymaps/default/readme.md @@ -0,0 +1,5 @@ +![[1x4] + 1 Macropad Layout](https://i.imgur.com/ZdXuIwb.png) + +# Default [1x4] + 1 Macropad Layout + +This is the default layout that comes flashed on every [1x4] + 1 Macropad. The right most key (red) is the rotary and the key is binded to layer switching. The second layer is left blank for the user. \ No newline at end of file diff --git a/keyboards/arrayperipherals/1x4p1/keymaps/via/keymap.c b/keyboards/arrayperipherals/1x4p1/keymaps/via/keymap.c new file mode 100644 index 00000000000..d419050a3db --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/keymaps/via/keymap.c @@ -0,0 +1,45 @@ +/* +Copyright 2020 David Doan + +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 + +void encoder_update_user(uint8_t index, bool clockwise) { + if (index == 0) { /* First encoder */ + if (clockwise) { + tap_code(KC_MS_WH_UP); + } else { + tap_code(KC_MS_WH_DOWN); + } + } +} + +// +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //button closest to usb is first + [0] = LAYOUT_ortho_1x5( + KC_ESC, KC_TAB, KC_LSHIFT, KC_LCTRL, TG(1) + ), + + [1] = LAYOUT_ortho_1x5( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(2) + ), + [2] = LAYOUT_ortho_1x5( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(3) + ), + [3] = LAYOUT_ortho_1x5( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(0) + ) +}; diff --git a/keyboards/arrayperipherals/1x4p1/keymaps/via/rules.mk b/keyboards/arrayperipherals/1x4p1/keymaps/via/rules.mk new file mode 100644 index 00000000000..1e5b99807cb --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/keymaps/via/rules.mk @@ -0,0 +1 @@ +VIA_ENABLE = yes diff --git a/keyboards/arrayperipherals/1x4p1/readme.md b/keyboards/arrayperipherals/1x4p1/readme.md new file mode 100644 index 00000000000..c9374cb7a84 --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/readme.md @@ -0,0 +1,16 @@ +# [1x4] + 1 Macropad + +![[1x4] + 1 Macropad](https://images.squarespace-cdn.com/content/v1/5f5e7d5dc43c166c56c0ae39/1606977576841-KIT0TOI6L3FO8FTS4ZHB/ke17ZwdGBToddI8pDm48kDk1dm1oSR9gCa1mX4KqzjN7gQa3H78H3Y0txjaiv_0fDoOvxcdMmMKkDsyUqMSsMWxHk725yiiHCCLfrh8O1z4YTzHvnKhyp6Da-NYroOW3ZGjoBKy3azqku80C789l0luj0xCD0oh5KMc0gpox0u-wQWxfQHg04OxgQwaUq2yiAcNt5Kg2tE9yEtYfM4xwaw/DSC_0116.jpg) + +A macropad with a 1x4 matrix array with an additional rotary that also functions as a button. [More info at arrayperipherals.com](https://www.arrayperipherals.com/) + +* Keyboard Maintainer: [David Doan](https://github.com/daviddoan) +* Hardware Supported: Adafruit ItsyBitsy 32u4 +* Hardware Availability: [arrayperipherals.com](https://www.arrayperipherals.com/) + +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). + +## Resetting macropad into bootloader mode. + +The stock version of the macropad has bootmagic lite enabled. To trigger the bootloader, the first key (key furthest way from the rotary) needs to be held down when plugging the keyboard in. +NOTE: Using bootmagic lite will always reset the EEPROM, so you will lose any settings that have been saved. diff --git a/keyboards/arrayperipherals/1x4p1/rules.mk b/keyboards/arrayperipherals/1x4p1/rules.mk new file mode 100644 index 00000000000..3bbc6dbf879 --- /dev/null +++ b/keyboards/arrayperipherals/1x4p1/rules.mk @@ -0,0 +1,24 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +BLUETOOTH_ENABLE = no # Enable Bluetooth +AUDIO_ENABLE = no # Audio output +UNICODE_ENABLE = yes +ENCODER_ENABLE = yes diff --git a/keyboards/arrayperipherals/readme.md b/keyboards/arrayperipherals/readme.md new file mode 100644 index 00000000000..3c6aba591fc --- /dev/null +++ b/keyboards/arrayperipherals/readme.md @@ -0,0 +1,5 @@ +# Array Peripherals + +Array Peripherals is a small company operating out of an apartment by two brothers located in Northern California. + +Website: [Array Peripherals](www.arrayperipherals.com)