From 99c6829bf06b1cd43365e6c7ef2f136062b8ad06 Mon Sep 17 00:00:00 2001 From: ryjelsum <79069893+ryjelsum@users.noreply.github.com> Date: Sat, 27 Nov 2021 21:52:53 -0800 Subject: [PATCH] [Keyboard] Add 40percent.club's 'polypad' PCB (#15158) Co-authored-by: Joel Challis Co-authored-by: Sergey Vlasov Co-authored-by: Drashna Jaelre --- keyboards/40percentclub/polyandry/config.h | 90 +++++++++++++++++++ keyboards/40percentclub/polyandry/info.json | 27 ++++++ .../polyandry/keymaps/default/keymap.c | 30 +++++++ keyboards/40percentclub/polyandry/polyandry.c | 16 ++++ keyboards/40percentclub/polyandry/polyandry.h | 24 +++++ .../40percentclub/polyandry/promicro/config.h | 34 +++++++ .../polyandry/promicro/promicro.c | 16 ++++ .../polyandry/promicro/promicro.h | 27 ++++++ .../40percentclub/polyandry/promicro/rules.mk | 5 ++ keyboards/40percentclub/polyandry/readme.md | 53 +++++++++++ keyboards/40percentclub/polyandry/rules.mk | 17 ++++ .../40percentclub/polyandry/teensy2/config.h | 36 ++++++++ .../40percentclub/polyandry/teensy2/rules.mk | 5 ++ .../40percentclub/polyandry/teensy2/teensy2.c | 16 ++++ .../40percentclub/polyandry/teensy2/teensy2.h | 32 +++++++ 15 files changed, 428 insertions(+) create mode 100644 keyboards/40percentclub/polyandry/config.h create mode 100644 keyboards/40percentclub/polyandry/info.json create mode 100644 keyboards/40percentclub/polyandry/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/polyandry/polyandry.c create mode 100644 keyboards/40percentclub/polyandry/polyandry.h create mode 100644 keyboards/40percentclub/polyandry/promicro/config.h create mode 100644 keyboards/40percentclub/polyandry/promicro/promicro.c create mode 100644 keyboards/40percentclub/polyandry/promicro/promicro.h create mode 100644 keyboards/40percentclub/polyandry/promicro/rules.mk create mode 100644 keyboards/40percentclub/polyandry/readme.md create mode 100644 keyboards/40percentclub/polyandry/rules.mk create mode 100644 keyboards/40percentclub/polyandry/teensy2/config.h create mode 100644 keyboards/40percentclub/polyandry/teensy2/rules.mk create mode 100644 keyboards/40percentclub/polyandry/teensy2/teensy2.c create mode 100644 keyboards/40percentclub/polyandry/teensy2/teensy2.h diff --git a/keyboards/40percentclub/polyandry/config.h b/keyboards/40percentclub/polyandry/config.h new file mode 100644 index 00000000000..4d64e2d209c --- /dev/null +++ b/keyboards/40percentclub/polyandry/config.h @@ -0,0 +1,90 @@ +/* Copyright 2021 + * + * 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 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER di0ib +#define PRODUCT Polypad + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 5 + +//more detailed config options start below: + + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/40percentclub/polyandry/info.json b/keyboards/40percentclub/polyandry/info.json new file mode 100644 index 00000000000..d0d1a00f86c --- /dev/null +++ b/keyboards/40percentclub/polyandry/info.json @@ -0,0 +1,27 @@ +{ + "keyboard_name": "Polyandry", + "url": "", + "maintainer": "QMK", + "layouts": { + "LAYOUT": { + "layout": [ + {"label": "k000", "x": 0, "y": 0}, + {"label": "k001", "x": 1, "y": 0}, + {"label": "k002", "x": 2, "y": 0}, + + {"label": "k003", "x": 0, "y": 1}, + {"label": "k004", "x": 1, "y": 1}, + {"label": "k005", "x": 2, "y": 1}, + + {"label": "k006", "x": 0, "y": 2}, + {"label": "k007", "x": 1, "y": 2}, + {"label": "k008", "x": 2, "y": 2}, + + {"label": "k009", "x": 0, "y": 3}, + {"label": "k010", "x": 1, "y": 3}, + {"label": "k011", "x": 2, "y": 3} + + ] + } + } +} diff --git a/keyboards/40percentclub/polyandry/keymaps/default/keymap.c b/keyboards/40percentclub/polyandry/keymaps/default/keymap.c new file mode 100644 index 00000000000..3e1f278b35e --- /dev/null +++ b/keyboards/40percentclub/polyandry/keymaps/default/keymap.c @@ -0,0 +1,30 @@ +/* Copyright 2021 + * + * 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] = { + + LAYOUT( + KC_1, KC_2, KC_3, + KC_4, KC_5, KC_6, + KC_7, KC_8, KC_9, + KC_0, KC_A, KC_B + ), + +}; + + + diff --git a/keyboards/40percentclub/polyandry/polyandry.c b/keyboards/40percentclub/polyandry/polyandry.c new file mode 100644 index 00000000000..2b4be589b8f --- /dev/null +++ b/keyboards/40percentclub/polyandry/polyandry.c @@ -0,0 +1,16 @@ +/* Copyright 2021 + * + * 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 "polyandry.h" diff --git a/keyboards/40percentclub/polyandry/polyandry.h b/keyboards/40percentclub/polyandry/polyandry.h new file mode 100644 index 00000000000..5baf87ba623 --- /dev/null +++ b/keyboards/40percentclub/polyandry/polyandry.h @@ -0,0 +1,24 @@ +/* Copyright 2021 + * + * 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" + +#ifdef KEYBOARD_40percentclub_polyandry_promicro + #include "promicro.h" +#elif KEYBOARD_40percentclub_polyandry_teensy2 + #include "teensy2.h" +#endif diff --git a/keyboards/40percentclub/polyandry/promicro/config.h b/keyboards/40percentclub/polyandry/promicro/config.h new file mode 100644 index 00000000000..e6f8643c441 --- /dev/null +++ b/keyboards/40percentclub/polyandry/promicro/config.h @@ -0,0 +1,34 @@ +/* Copyright 2021 + * + * 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" + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 12 + +/* key matrix pins + * Direct pins is not used because there is not a shared ground position + * between all compatible microcontrollers. +*/ +#define MATRIX_ROW_PINS { D7 } +#define MATRIX_COL_PINS { D1, D0, D4, C6, E6, B4, F4, F5, F6, F7, B3, B2 } +#define UNUSED_PINS + +/* doesn't really matter lol */ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/40percentclub/polyandry/promicro/promicro.c b/keyboards/40percentclub/polyandry/promicro/promicro.c new file mode 100644 index 00000000000..ea1dd517886 --- /dev/null +++ b/keyboards/40percentclub/polyandry/promicro/promicro.c @@ -0,0 +1,16 @@ +/* Copyright 2021 + * + * 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 "promicro.h" diff --git a/keyboards/40percentclub/polyandry/promicro/promicro.h b/keyboards/40percentclub/polyandry/promicro/promicro.h new file mode 100644 index 00000000000..65e2b4b9c2a --- /dev/null +++ b/keyboards/40percentclub/polyandry/promicro/promicro.h @@ -0,0 +1,27 @@ +/* Copyright 2021 + * + * 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 "polyandry.h" + +#define LAYOUT( \ + K000, K001, K002, \ + K003, K004, K005, \ + K006, K007, K008, \ + K009, K010, K011 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 } \ +} diff --git a/keyboards/40percentclub/polyandry/promicro/rules.mk b/keyboards/40percentclub/polyandry/promicro/rules.mk new file mode 100644 index 00000000000..cf663a7ed6a --- /dev/null +++ b/keyboards/40percentclub/polyandry/promicro/rules.mk @@ -0,0 +1,5 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = caterina diff --git a/keyboards/40percentclub/polyandry/readme.md b/keyboards/40percentclub/polyandry/readme.md new file mode 100644 index 00000000000..b6acf3cd7ff --- /dev/null +++ b/keyboards/40percentclub/polyandry/readme.md @@ -0,0 +1,53 @@ +# Polyandry/polypad + +![Polyandry](https://1.bp.blogspot.com/-97uoICZvZec/XSdpvCVFFlI/AAAAAAACVZY/BlCRjxjDqDAxOZa6C5ddQr0OsFQ9VZv5wCLcBGAs/s1600/d1.jpg) +=== + +3x4/4x3 grid layout, multiple controllers supported +- Pro Micro +- PJRC Teensy 2.0 + +(**The below are not currently ported:**) + +- PJRC Teensy LC/3.2 +- PJRC Teensy 3.5/3.6 +- Adafruit ItsyBitsy ATMega32u4 +- Adafruit ItsyBitsy M0 +- Adafruit ItsyBitsy M4 + +The matrix is electrically 1x12 with no diodes, with a thirteenth pin used for the column rather than a ground in order to be compatible with all the listed microcontrollers.. + +The default keymap is a testing keymap that is intended to make sure all of the keys on the matrix are working and properly assigned. + +[The original (minimal arduino sketch) firmware, with support for some unsupported controllers](https://git.40percent.club/di0ib/Misc/src/branch/master/polyandry) + +Keyboard Maintainer: QMK Community +Hardware Supported: Polyandry PCB +Hardware Availability: [Polyandry gerbers are on 40percent.club](https://www.40percent.club/2019/07/polyandry.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/polyandry:default + or + qmk compile -kb 40percentclub/polyandry -km default + +Default firmware is for an Arduino Pro Micro knockoff. + +If you would like to specify a controller: + + make 40percentclub/polyandry/promicro:default + or + qmk compile -kb 40percentclub/polyandry/promicro -km default + make 40percentclub/polyandry/teensy2:default + or + qmk compile -kb 40percentclub/polyandry/teensy2 -km default + +## Bootloader + +Enter the bootloader in 3 ways: + +* **Bootmagic reset**: Hold down the top left key of the keyboard (top right or bottom left in horizontal configuration) +* **Physical reset**: Briefly press the button on the bottom of the microcontroller or, if not present short the pin marked RST to a GND. +* **Keycode in layout**: Press the key mapped to `RESET` if it is available + +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/40percentclub/polyandry/rules.mk b/keyboards/40percentclub/polyandry/rules.mk new file mode 100644 index 00000000000..4632df1dee6 --- /dev/null +++ b/keyboards/40percentclub/polyandry/rules.mk @@ -0,0 +1,17 @@ +# 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 = 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +AUDIO_ENABLE = no # Audio output + +DEFAULT_FOLDER = 40percentclub/polyandry/promicro diff --git a/keyboards/40percentclub/polyandry/teensy2/config.h b/keyboards/40percentclub/polyandry/teensy2/config.h new file mode 100644 index 00000000000..d730ce6f940 --- /dev/null +++ b/keyboards/40percentclub/polyandry/teensy2/config.h @@ -0,0 +1,36 @@ +/* Copyright 2021 + * + * 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" + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 12 + +/* key matrix pins */ + +// Note from original contributor (ryjelsum): +// Untested - don't have teensy2. if some keys do not function or are in wrong place, +// please check the pin definitions. I may have screwed up. :) + +#define MATRIX_ROW_PINS { D3 } +#define MATRIX_COL_PINS { B7, D0, D1, D2, C6, C7, F6, F7, B6, B5, D7, D6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/40percentclub/polyandry/teensy2/rules.mk b/keyboards/40percentclub/polyandry/teensy2/rules.mk new file mode 100644 index 00000000000..320633f80f3 --- /dev/null +++ b/keyboards/40percentclub/polyandry/teensy2/rules.mk @@ -0,0 +1,5 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = halfkay diff --git a/keyboards/40percentclub/polyandry/teensy2/teensy2.c b/keyboards/40percentclub/polyandry/teensy2/teensy2.c new file mode 100644 index 00000000000..33cfb6e553c --- /dev/null +++ b/keyboards/40percentclub/polyandry/teensy2/teensy2.c @@ -0,0 +1,16 @@ +/* Copyright 2021 + * + * 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 "teensy2.h" diff --git a/keyboards/40percentclub/polyandry/teensy2/teensy2.h b/keyboards/40percentclub/polyandry/teensy2/teensy2.h new file mode 100644 index 00000000000..118eb353a4f --- /dev/null +++ b/keyboards/40percentclub/polyandry/teensy2/teensy2.h @@ -0,0 +1,32 @@ +/* Copyright 2021 + * + * 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 + +//NOTE TO FUTURE FROM RYJELSUM (original contributor): +//This has been unchanged from the promicro.h file. +//I DO NOT HAVE A TEENSY 2.0 TO TEST WITH. +//I believe this should still work - but it's not a sure thing. + +#include "polyandry.h" + +#define LAYOUT( \ + K000, K001, K002, \ + K003, K004, K005, \ + K006, K007, K008, \ + K009, K010, K011 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 } \ +}