Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

z12 micropad by zigotica #14583

Merged
merged 18 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions keyboards/z12/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# z12
zigotica marked this conversation as resolved.
Show resolved Hide resolved

Firmware for [z12 micropad](https://github.com/zigotica/mechanical-keyboards/tree/main/z12) designed by @zigotica
57 changes: 57 additions & 0 deletions keyboards/z12/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* Copyright 2020 Sergi Meseguer <[email protected]>

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

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x7A74
#define PRODUCT_ID 0x0001
#define DEVICE_VER 0x0001
#define MANUFACTURER zigotica
#define PRODUCT z12
#define DESCRIPTION micro pad with 6x MX/Choc v[1|2] switches, \
4x 6x6mm momentary buttons, \
2x EC11 rotary encoders and \
1x 128x32 OLED display
zigotica marked this conversation as resolved.
Show resolved Hide resolved

#define ENCODERS_PAD_A { B4, B2 }
#define ENCODERS_PAD_B { B5, B6 }
#define ENCODER_DIRECTION_FLIP

/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 4

/*Keyboard Matrix Assignments */

#define DIRECT_PINS { \
{ NO_PIN, E6, C6, NO_PIN }, \
{ D2, D7, D4, D3 }, \
{ F7, B1, B3, NO_PIN }, \
{ F6, F5, F4, NO_PIN } \
}

#define UNUSED_PINS

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5

/* 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
30 changes: 30 additions & 0 deletions keyboards/z12/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Copyright 2020 Sergi Meseguer <[email protected]>

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

#include "config_common.h"

#ifdef OLED_DRIVER_ENABLE
#define OLED_DISPLAY_128X32
#endif
zigotica marked this conversation as resolved.
Show resolved Hide resolved

// EC11 encoders' resolution.
// Reduce the value to 2 if you feel missing values:
#define ENCODER_RESOLUTION 4

// Allows correct registered values by rotary encoder:
#define TAP_CODE_DELAY 10
78 changes: 78 additions & 0 deletions keyboards/z12/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/* Copyright 2020 Sergi Meseguer <[email protected]>

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

enum layers {
BASE = 0
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* Base Layer: BASE
*
* ,-----------------------.
* | | o | o | |
* |-------+---+---+-------|
* | o | o | o | o |
* |-------+-------+-------|
* | o | o | o |
* |-------+-------+-------|
* | o | o | o |
* |-------+-------+-------|
*/
[BASE] = LAYOUT(
KC_Q, KC_W,
KC_E, KC_R, KC_T, KC_Y,
KC_U, KC_I, KC_O,
KC_P, KC_K, KC_A
),

/*
* TEMPLATE
*
* ,-----------------------.
* | | o | o | |
* |-------+---+---+-------|
* | o | o | o | o |
* |-------+-------+-------|
* | o | o | o |
* |-------+-------+-------|
* | o | o | o |
* |-------+-------+-------|
*/

};

#ifdef ENCODER_ENABLE
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { // LEFT
// Scroll
if (clockwise) {
tap_code(KC_PGDN);
} else {
tap_code(KC_PGUP);
}
} else { // RIGHT
// Volume control.
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
}
#endif
zigotica marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions keyboards/z12/keymaps/default/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# (TEMPORARILY DISABLED FOR NOW)
zigotica marked this conversation as resolved.
Show resolved Hide resolved
OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays
zigotica marked this conversation as resolved.
Show resolved Hide resolved
RAW_ENABLE = yes
TAP_DANCE_ENABLE = yes
MOUSEKEY_ENABLE = yes
38 changes: 38 additions & 0 deletions keyboards/z12/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# MCU name
MCU = atmega32u4

# Bootloader selection
# Teensy halfkay
# Pro Micro caterina
# Atmel DFU atmel-dfu
# LUFA DFU lufa-dfu
# QMK DFU qmk-dfu
# ATmega32A bootloadHID
# ATmega328P USBasp
zigotica marked this conversation as resolved.
Show resolved Hide resolved
BOOTLOADER = caterina

# Build Options
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
MOUSEKEY_ENABLE = no # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = no # Console for debug
COMMAND_ENABLE = no # Commands for debug and configuration
ENCODER_ENABLE = yes # Enables the use of encoders
# 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 on B7 by default
zigotica marked this conversation as resolved.
Show resolved Hide resolved
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
AUDIO_ENABLE = no # Audio output on port C6
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
SPLIT_KEYBOARD = no # Split common
LTO_ENABLE = yes # Enables Link Time Optimization (LTO) which reduces the compiled size
OLED_DRIVER_ENABLE = yes # Enables the use of OLED displays

DEFAULT_FOLDER = z12
zigotica marked this conversation as resolved.
Show resolved Hide resolved

17 changes: 17 additions & 0 deletions keyboards/z12/z12.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* Copyright 2020 Sergi Meseguer <[email protected]>
*
* 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 "z12.h"
zigotica marked this conversation as resolved.
Show resolved Hide resolved
34 changes: 34 additions & 0 deletions keyboards/z12/z12.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* Copyright 2020 Sergi Meseguer <[email protected]>
*
* 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"

/* This a shortcut to help you visually see your layout */

#define ___ KC_NO

#define LAYOUT( \
BN4, BN2, \
SW7, BN3, BN1, SW8, \
SW4, SW5, SW6, \
SW3, SW2, SW1 \
) \
{ \
{ ___, BN4, BN2, ___ }, \
{ SW7, BN3, BN1, SW8 }, \
{ SW4, SW5, SW6, ___ }, \
{ SW3, SW2, SW1, ___ }, \
}