summaryrefslogtreecommitdiff
path: root/keyboards/pabile/p20
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/pabile/p20')
-rw-r--r--keyboards/pabile/p20/config.h26
-rw-r--r--keyboards/pabile/p20/keymaps/default/keymap.c38
-rw-r--r--keyboards/pabile/p20/p20.c1
-rw-r--r--keyboards/pabile/p20/p20.h18
-rw-r--r--keyboards/pabile/p20/readme.md16
-rw-r--r--keyboards/pabile/p20/rules.mk37
6 files changed, 136 insertions, 0 deletions
diff --git a/keyboards/pabile/p20/config.h b/keyboards/pabile/p20/config.h
new file mode 100644
index 0000000000..8a52c1bf1c
--- /dev/null
+++ b/keyboards/pabile/p20/config.h
@@ -0,0 +1,26 @@
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0x6666
+#define PRODUCT_ID 0x6667
+#define DEVICE_VER 0x0001
+#define MANUFACTURER Pabile
+#define PRODUCT P20
+#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
diff --git a/keyboards/pabile/p20/keymaps/default/keymap.c b/keyboards/pabile/p20/keymaps/default/keymap.c
new file mode 100644
index 0000000000..6b815e72e8
--- /dev/null
+++ b/keyboards/pabile/p20/keymaps/default/keymap.c
@@ -0,0 +1,38 @@
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT_ortho_5x4(
+ 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_ortho_5x4(
+ 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_ortho_5x4(
+ 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*/
+ }
+ }
+}
diff --git a/keyboards/pabile/p20/p20.c b/keyboards/pabile/p20/p20.c
new file mode 100644
index 0000000000..c17efac9b1
--- /dev/null
+++ b/keyboards/pabile/p20/p20.c
@@ -0,0 +1 @@
+#include "p20.h"
diff --git a/keyboards/pabile/p20/p20.h b/keyboards/pabile/p20/p20.h
new file mode 100644
index 0000000000..b7467dc150
--- /dev/null
+++ b/keyboards/pabile/p20/p20.h
@@ -0,0 +1,18 @@
+#pragma once
+
+#include "quantum.h"
+
+#define LAYOUT_ortho_5x4( \
+ 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} \
+}
diff --git a/keyboards/pabile/p20/readme.md b/keyboards/pabile/p20/readme.md
new file mode 100644
index 0000000000..256a4772ec
--- /dev/null
+++ b/keyboards/pabile/p20/readme.md
@@ -0,0 +1,16 @@
+# P20
+
+![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)
+
+A 5x4 grid keyboard with 2 rotary encoders.
+
+* Keyboard Maintainer: [pabile](https://github.com/pabile)
+* Hardware Supported: Pabile P20 PCB, Pro Micro
+* Hardware Availability: [Info at pabileonline.blogspot.com](https://pabileonline.blogspot.com/search/label/pabile20)
+
+Make example for this keyboard (after setting up your build environment):
+
+ make pabile/p20:default
+
+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/pabile/p20/rules.mk b/keyboards/pabile/p20/rules.mk
new file mode 100644
index 0000000000..d4fa25323a
--- /dev/null
+++ b/keyboards/pabile/p20/rules.mk
@@ -0,0 +1,37 @@
+# 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
+BOOTLOADER = caterina
+
+# Build Options
+# change yes to no to disable
+#
+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
+# 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
+MIDI_ENABLE = no # MIDI support
+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
+UNICODE_ENABLE = yes # Unicode
+IOS_DEVICE_ENABLE = no # connect to IOS Device
+ENCODER_ENABLE = yes
+
+LAYOUTS = ortho_5x4