1
0
Fork 0
forked from forks/qmk_firmware

Added p20 macropad

This commit is contained in:
pabile 2020-04-17 11:09:21 +08:00 committed by GitHub
parent 3cf0e5b80a
commit 5131eb7511
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 127 additions and 0 deletions

View file

@ -0,0 +1,9 @@
# Pabile20
https://pabileonline.blogspot.com/search/label/pabile20
A 5x4 grid keyboard with 2 rotary encoders.
Layouts
![Linear grid](https://github.com/pabile/Pabile20/blob/master/_bak/layout-grid.jpg)
![Numeric pad](https://github.com/pabile/Pabile20/blob/master/_bak/layout-numpad.jpg)

View file

@ -0,0 +1,26 @@
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x0000
#define PRODUCT_ID 0x0000
#define DEVICE_VER 0x0001
#define MANUFACTURER Pabile
#define PRODUCT Pabile20
#define DESCRIPTION 5x4 Macropad
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 4
/* pin-out */
#define MATRIX_ROW_PINS { B3, B4, B5, D7, E6 }
#define MATRIX_COL_PINS { D0, B2, D4, B6 }
#define UNUSED_PINS
#define ENCODERS_PAD_A { F5, F7 }
#define ENCODERS_PAD_B { F6, B1 }
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW

View file

@ -0,0 +1,39 @@
#include QMK_KEYBOARD_H
#include "backlight.h"
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT(
KC_PSLS, KC_PMNS, KC_PAST, KC_MPLY,
KC_P7, KC_P8, KC_P9, KC_PMNS,
KC_P4, KC_P5, KC_P6, KC_PPLS,
KC_P1, KC_P2, KC_P3, KC_TAB,
LT(2,KC_P0), KC_PCMM, KC_PDOT, LT(1,KC_PENT)),
[1] = LAYOUT(
KC_NLCK, KC_UNDS, KC_NO, KC_NO,
KC_AMPR, KC_ASTR, KC_LPRN, KC_EQL,
KC_DLR, KC_PERC, KC_CIRC, KC_NO,
KC_EXLM, KC_AT, KC_HASH, KC_NO,
KC_RPRN, KC_NO, KC_PSLS, KC_NO),
[2] = LAYOUT(
KC_NLCK, KC_NO, KC_NO, KC_NO,
KC_BTN1, KC_MS_U, KC_BTN2, KC_NO,
KC_MS_L, KC_MS_D, KC_MS_R, KC_TAB,
KC_WH_U, KC_NO, KC_WH_D, KC_NO,
KC_NO, KC_NO, KC_DEL, KC_ESC)
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) { /* First encoder */
if (clockwise) {
tap_code(KC_WH_U); /*mouse wheel up*/
} else {
tap_code(KC_WH_D); /*mouse wheel down */
}
} else if (index == 1) { /* Second encoder */
if (clockwise) {
tap_code(KC_VOLD); /*volume down*/
} else {
tap_code(KC_VOLU); /*volume up*/
}
}
}

View file

@ -0,0 +1 @@
#include "p20.h"

View file

@ -0,0 +1,21 @@
#ifndef P20_H
#define P20_H
#include "quantum.h"
#define LAYOUT( \
k00, k01, k02, k03, \
k10, k11, k12, k13, \
k20, k21, k22, k23, \
k30, k31, k32, k33, \
k40, k41, k42, k43 \
) \
{ \
{k00, k01, k02, k03}, \
{k10, k11, k12, k13}, \
{k20, k21, k22, k23}, \
{k30, k31, k32, k33}, \
{k40, k41, k42, k43} \
}
#endif

View file

@ -0,0 +1,31 @@
# MCU name
MCU = atmega32u4
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
BOOTLOADER = caterina
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # 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
NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = yes # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
IOS_DEVICE_ENABLE = no # connect to IOS Device
ENCODER_ENABLE = yes
LAYOUTS = ortho