diff options
| author | Sergi Meseguer <zigotica@gmail.com> | 2021-09-28 07:10:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-27 22:10:10 -0700 |
| commit | 574b3d8a5a6891fff6d8058abc5c091f65f8dec2 (patch) | |
| tree | 6e87885578198b5447afac36151d0d2908eaa017 | |
| parent | 2742d0c4c119c35980997ee43d9ce0fc412ec250 (diff) | |
| download | qmk_firmware-574b3d8a5a6891fff6d8058abc5c091f65f8dec2.tar.gz qmk_firmware-574b3d8a5a6891fff6d8058abc5c091f65f8dec2.zip | |
[Keyboard] z12 micropad by zigotica (#14583)
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
| -rw-r--r-- | keyboards/z12/config.h | 53 | ||||
| -rw-r--r-- | keyboards/z12/info.json | 26 | ||||
| -rw-r--r-- | keyboards/z12/keymaps/default/config.h | 26 | ||||
| -rw-r--r-- | keyboards/z12/keymaps/default/keymap.c | 59 | ||||
| -rw-r--r-- | keyboards/z12/keymaps/default/readme.md | 3 | ||||
| -rw-r--r-- | keyboards/z12/keymaps/default/rules.mk | 2 | ||||
| -rw-r--r-- | keyboards/z12/readme.md | 3 | ||||
| -rw-r--r-- | keyboards/z12/rules.mk | 24 | ||||
| -rw-r--r-- | keyboards/z12/z12.c | 39 | ||||
| -rw-r--r-- | keyboards/z12/z12.h | 34 |
10 files changed, 269 insertions, 0 deletions
diff --git a/keyboards/z12/config.h b/keyboards/z12/config.h new file mode 100644 index 000000000..7f897b795 --- /dev/null +++ b/keyboards/z12/config.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /* Copyright 2020 Sergi Meseguer <zigotica@gmail.com> | ||
| 2 | |||
| 3 | This program is free software: you can redistribute it and/or modify | ||
| 4 | it under the terms of the GNU General Public License as published by | ||
| 5 | the Free Software Foundation, either version 2 of the License, or | ||
| 6 | (at your option) any later version. | ||
| 7 | |||
| 8 | This program is distributed in the hope that it will be useful, | ||
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | GNU General Public License for more details. | ||
| 12 | |||
| 13 | You should have received a copy of the GNU General Public License | ||
| 14 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #include "config_common.h" | ||
| 20 | |||
| 21 | /* USB Device descriptor parameter */ | ||
| 22 | #define VENDOR_ID 0x7A74 | ||
| 23 | #define PRODUCT_ID 0x0001 | ||
| 24 | #define DEVICE_VER 0x0001 | ||
| 25 | #define MANUFACTURER zigotica | ||
| 26 | #define PRODUCT z12 | ||
| 27 | |||
| 28 | #define ENCODERS_PAD_A { B4, B2 } | ||
| 29 | #define ENCODERS_PAD_B { B5, B6 } | ||
| 30 | #define ENCODER_DIRECTION_FLIP | ||
| 31 | |||
| 32 | /* key matrix size */ | ||
| 33 | #define MATRIX_ROWS 4 | ||
| 34 | #define MATRIX_COLS 4 | ||
| 35 | |||
| 36 | /*Keyboard Matrix Assignments */ | ||
| 37 | |||
| 38 | #define DIRECT_PINS { \ | ||
| 39 | { NO_PIN, E6, C6, NO_PIN }, \ | ||
| 40 | { D2, D7, D4, D3 }, \ | ||
| 41 | { F7, B1, B3, NO_PIN }, \ | ||
| 42 | { F6, F5, F4, NO_PIN } \ | ||
| 43 | } | ||
| 44 | |||
| 45 | #define UNUSED_PINS | ||
| 46 | |||
| 47 | /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ | ||
| 48 | #define DEBOUNCE 5 | ||
| 49 | |||
| 50 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 51 | #define LOCKING_SUPPORT_ENABLE | ||
| 52 | /* Locking resynchronize hack */ | ||
| 53 | #define LOCKING_RESYNC_ENABLE | ||
diff --git a/keyboards/z12/info.json b/keyboards/z12/info.json new file mode 100644 index 000000000..3ae893757 --- /dev/null +++ b/keyboards/z12/info.json | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "z12", | ||
| 3 | "url": "https://github.com/zigotica/mechanical-keyboards/tree/main/z12", | ||
| 4 | "maintainer": "@zigotica", | ||
| 5 | "layouts": { | ||
| 6 | "LAYOUT": { | ||
| 7 | "layout": [ | ||
| 8 | {"x": 1, "y": 0}, | ||
| 9 | {"x": 2, "y": 0}, | ||
| 10 | |||
| 11 | {"x": 0, "y": 0.5}, | ||
| 12 | {"x": 1, "y": 1}, | ||
| 13 | {"x": 2, "y": 1}, | ||
| 14 | {"x": 3, "y": 0.5}, | ||
| 15 | |||
| 16 | {"x": 0.5, "y": 2}, | ||
| 17 | {"x": 1.5, "y": 2}, | ||
| 18 | {"x": 2.5, "y": 2}, | ||
| 19 | |||
| 20 | {"x": 0.5, "y": 3}, | ||
| 21 | {"x": 1.5, "y": 3}, | ||
| 22 | {"x": 2.5, "y": 3}, | ||
| 23 | ] | ||
| 24 | } | ||
| 25 | } | ||
| 26 | } | ||
diff --git a/keyboards/z12/keymaps/default/config.h b/keyboards/z12/keymaps/default/config.h new file mode 100644 index 000000000..1fcf924f3 --- /dev/null +++ b/keyboards/z12/keymaps/default/config.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | /* Copyright 2020 Sergi Meseguer <zigotica@gmail.com> | ||
| 2 | |||
| 3 | This program is free software: you can redistribute it and/or modify | ||
| 4 | it under the terms of the GNU General Public License as published by | ||
| 5 | the Free Software Foundation, either version 2 of the License, or | ||
| 6 | (at your option) any later version. | ||
| 7 | |||
| 8 | This program is distributed in the hope that it will be useful, | ||
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | GNU General Public License for more details. | ||
| 12 | |||
| 13 | You should have received a copy of the GNU General Public License | ||
| 14 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #pragma once | ||
| 18 | |||
| 19 | #define OLED_DISPLAY_128X32 | ||
| 20 | |||
| 21 | // EC11 encoders' resolution. | ||
| 22 | // Reduce the value to 2 if you feel missing values: | ||
| 23 | #define ENCODER_RESOLUTION 4 | ||
| 24 | |||
| 25 | // Allows correct registered values by rotary encoder: | ||
| 26 | #define TAP_CODE_DELAY 10 | ||
diff --git a/keyboards/z12/keymaps/default/keymap.c b/keyboards/z12/keymaps/default/keymap.c new file mode 100644 index 000000000..16a6c1f70 --- /dev/null +++ b/keyboards/z12/keymaps/default/keymap.c | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | /* Copyright 2020 Sergi Meseguer <zigotica@gmail.com> | ||
| 2 | |||
| 3 | This program is free software: you can redistribute it and/or modify | ||
| 4 | it under the terms of the GNU General Public License as published by | ||
| 5 | the Free Software Foundation, either version 2 of the License, or | ||
| 6 | (at your option) any later version. | ||
| 7 | |||
| 8 | This program is distributed in the hope that it will be useful, | ||
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | GNU General Public License for more details. | ||
| 12 | |||
| 13 | You should have received a copy of the GNU General Public License | ||
| 14 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include QMK_KEYBOARD_H | ||
| 18 | |||
| 19 | enum layers { | ||
| 20 | BASE = 0 | ||
| 21 | }; | ||
| 22 | |||
| 23 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 24 | /* | ||
| 25 | * Base Layer: BASE | ||
| 26 | * | ||
| 27 | * ,-----------------------. | ||
| 28 | * | | o | o | | | ||
| 29 | * |-------+---+---+-------| | ||
| 30 | * | o | o | o | o | | ||
| 31 | * |-------+-------+-------| | ||
| 32 | * | o | o | o | | ||
| 33 | * |-------+-------+-------| | ||
| 34 | * | o | o | o | | ||
| 35 | * |-------+-------+-------| | ||
| 36 | */ | ||
| 37 | [BASE] = LAYOUT( | ||
| 38 | KC_Q, KC_W, | ||
| 39 | KC_E, KC_R, KC_T, KC_Y, | ||
| 40 | KC_U, KC_I, KC_O, | ||
| 41 | KC_P, KC_K, KC_A | ||
| 42 | ), | ||
| 43 | |||
| 44 | /* | ||
| 45 | * TEMPLATE | ||
| 46 | * | ||
| 47 | * ,-----------------------. | ||
| 48 | * | | o | o | | | ||
| 49 | * |-------+---+---+-------| | ||
| 50 | * | o | o | o | o | | ||
| 51 | * |-------+-------+-------| | ||
| 52 | * | o | o | o | | ||
| 53 | * |-------+-------+-------| | ||
| 54 | * | o | o | o | | ||
| 55 | * |-------+-------+-------| | ||
| 56 | */ | ||
| 57 | |||
| 58 | }; | ||
| 59 | |||
diff --git a/keyboards/z12/keymaps/default/readme.md b/keyboards/z12/keymaps/default/readme.md new file mode 100644 index 000000000..5f30ab6a3 --- /dev/null +++ b/keyboards/z12/keymaps/default/readme.md | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # Default z12 Layout | ||
| 2 | |||
| 3 | This is the default layout that comes flashed on every z12. | ||
diff --git a/keyboards/z12/keymaps/default/rules.mk b/keyboards/z12/keymaps/default/rules.mk new file mode 100644 index 000000000..b220469c6 --- /dev/null +++ b/keyboards/z12/keymaps/default/rules.mk | |||
| @@ -0,0 +1,2 @@ | |||
| 1 | OLED_ENABLE = yes # Enables the use of OLED displays | ||
| 2 | MOUSEKEY_ENABLE = yes | ||
diff --git a/keyboards/z12/readme.md b/keyboards/z12/readme.md new file mode 100644 index 000000000..17e4bfdb8 --- /dev/null +++ b/keyboards/z12/readme.md | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | # z12 | ||
| 2 | |||
| 3 | Firmware for [z12 micropad](https://github.com/zigotica/mechanical-keyboards/tree/main/z12) designed by @zigotica | ||
diff --git a/keyboards/z12/rules.mk b/keyboards/z12/rules.mk new file mode 100644 index 000000000..32cdab8e9 --- /dev/null +++ b/keyboards/z12/rules.mk | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = atmega32u4 | ||
| 3 | |||
| 4 | # Bootloader selection | ||
| 5 | BOOTLOADER = caterina | ||
| 6 | |||
| 7 | # Build Options | ||
| 8 | BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite | ||
| 9 | MOUSEKEY_ENABLE = no # Mouse keys | ||
| 10 | EXTRAKEY_ENABLE = yes # Audio control and System control | ||
| 11 | CONSOLE_ENABLE = no # Console for debug | ||
| 12 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 13 | ENCODER_ENABLE = yes # Enables the use of encoders | ||
| 14 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | ||
| 15 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 16 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 17 | NKRO_ENABLE = no # USB Nkey Rollover | ||
| 18 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 19 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | ||
| 20 | AUDIO_ENABLE = no # Audio output | ||
| 21 | LTO_ENABLE = yes # Enables Link Time Optimization (LTO) which reduces the compiled size | ||
| 22 | OLED_ENABLE = yes # Enables the use of OLED displays | ||
| 23 | OLED_DRIVER = SSD1306 # Enables the use of OLED displays | ||
| 24 | |||
diff --git a/keyboards/z12/z12.c b/keyboards/z12/z12.c new file mode 100644 index 000000000..99fe62ab9 --- /dev/null +++ b/keyboards/z12/z12.c | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* Copyright 2020 Sergi Meseguer <zigotica@gmail.com> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "z12.h" | ||
| 18 | |||
| 19 | #ifdef ENCODER_ENABLE | ||
| 20 | bool encoder_update_kb(uint8_t index, bool clockwise) { | ||
| 21 | if (!encoder_update_user(index, clockwise)) { return false; } | ||
| 22 | if (index == 0) { // LEFT | ||
| 23 | // Scroll | ||
| 24 | if (clockwise) { | ||
| 25 | tap_code_delay(KC_PGDN, 10); | ||
| 26 | } else { | ||
| 27 | tap_code_delay(KC_PGUP, 10); | ||
| 28 | } | ||
| 29 | } else { // RIGHT | ||
| 30 | // Volume control. | ||
| 31 | if (clockwise) { | ||
| 32 | tap_code_delay(KC_VOLU, 10); | ||
| 33 | } else { | ||
| 34 | tap_code_delay(KC_VOLD, 10); | ||
| 35 | } | ||
| 36 | } | ||
| 37 | return false; | ||
| 38 | } | ||
| 39 | #endif | ||
diff --git a/keyboards/z12/z12.h b/keyboards/z12/z12.h new file mode 100644 index 000000000..0ea6c303f --- /dev/null +++ b/keyboards/z12/z12.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | /* Copyright 2020 Sergi Meseguer <zigotica@gmail.com> | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #include "quantum.h" | ||
| 18 | |||
| 19 | /* This a shortcut to help you visually see your layout */ | ||
| 20 | |||
| 21 | #define ___ KC_NO | ||
| 22 | |||
| 23 | #define LAYOUT( \ | ||
| 24 | BN4, BN2, \ | ||
| 25 | SW7, BN3, BN1, SW8, \ | ||
| 26 | SW4, SW5, SW6, \ | ||
| 27 | SW3, SW2, SW1 \ | ||
| 28 | ) \ | ||
| 29 | { \ | ||
| 30 | { ___, BN4, BN2, ___ }, \ | ||
| 31 | { SW7, BN3, BN1, SW8 }, \ | ||
| 32 | { SW4, SW5, SW6, ___ }, \ | ||
| 33 | { SW3, SW2, SW1, ___ }, \ | ||
| 34 | } | ||
