aboutsummaryrefslogtreecommitdiff
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 000000000..8a52c1bf1
--- /dev/null
+++ b/keyboards/pabile/p20/config.h
@@ -0,0 +1,26 @@
1#pragma once
2
3#include "config_common.h"
4
5/* USB Device descriptor parameter */
6#define VENDOR_ID 0x6666
7#define PRODUCT_ID 0x6667
8#define DEVICE_VER 0x0001
9#define MANUFACTURER Pabile
10#define PRODUCT P20
11#define DESCRIPTION 5x4 Macropad
12
13/* key matrix size */
14#define MATRIX_ROWS 5
15#define MATRIX_COLS 4
16
17/* pin-out */
18#define MATRIX_ROW_PINS { B3, B4, B5, D7, E6 }
19#define MATRIX_COL_PINS { D0, B2, D4, B6 }
20#define UNUSED_PINS
21
22#define ENCODERS_PAD_A { F5, F7 }
23#define ENCODERS_PAD_B { F6, B1 }
24
25/* COL2ROW or ROW2COL */
26#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 000000000..6b815e72e
--- /dev/null
+++ b/keyboards/pabile/p20/keymaps/default/keymap.c
@@ -0,0 +1,38 @@
1#include QMK_KEYBOARD_H
2
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
4 [0] = LAYOUT_ortho_5x4(
5 KC_PSLS, KC_PMNS, KC_PAST, KC_MPLY,
6 KC_P7, KC_P8, KC_P9, KC_PMNS,
7 KC_P4, KC_P5, KC_P6, KC_PPLS,
8 KC_P1, KC_P2, KC_P3, KC_TAB,
9 LT(2,KC_P0), KC_PCMM, KC_PDOT, LT(1,KC_PENT)),
10 [1] = LAYOUT_ortho_5x4(
11 KC_NLCK, KC_UNDS, KC_NO, KC_NO,
12 KC_AMPR, KC_ASTR, KC_LPRN, KC_EQL,
13 KC_DLR, KC_PERC, KC_CIRC, KC_NO,
14 KC_EXLM, KC_AT, KC_HASH, KC_NO,
15 KC_RPRN, KC_NO, KC_PSLS, KC_NO),
16 [2] = LAYOUT_ortho_5x4(
17 KC_NLCK, KC_NO, KC_NO, KC_NO,
18 KC_BTN1, KC_MS_U, KC_BTN2, KC_NO,
19 KC_MS_L, KC_MS_D, KC_MS_R, KC_TAB,
20 KC_WH_U, KC_NO, KC_WH_D, KC_NO,
21 KC_NO, KC_NO, KC_DEL, KC_ESC)
22};
23
24void encoder_update_user(uint8_t index, bool clockwise) {
25 if (index == 0) { /* First encoder */
26 if (clockwise) {
27 tap_code(KC_WH_U); /*mouse wheel up*/
28 } else {
29 tap_code(KC_WH_D); /*mouse wheel down */
30 }
31 } else if (index == 1) { /* Second encoder */
32 if (clockwise) {
33 tap_code(KC_VOLD); /*volume down*/
34 } else {
35 tap_code(KC_VOLU); /*volume up*/
36 }
37 }
38}
diff --git a/keyboards/pabile/p20/p20.c b/keyboards/pabile/p20/p20.c
new file mode 100644
index 000000000..c17efac9b
--- /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 000000000..b7467dc15
--- /dev/null
+++ b/keyboards/pabile/p20/p20.h
@@ -0,0 +1,18 @@
1#pragma once
2
3#include "quantum.h"
4
5#define LAYOUT_ortho_5x4( \
6 k00, k01, k02, k03, \
7 k10, k11, k12, k13, \
8 k20, k21, k22, k23, \
9 k30, k31, k32, k33, \
10 k40, k41, k42, k43 \
11) \
12{ \
13 {k00, k01, k02, k03}, \
14 {k10, k11, k12, k13}, \
15 {k20, k21, k22, k23}, \
16 {k30, k31, k32, k33}, \
17 {k40, k41, k42, k43} \
18}
diff --git a/keyboards/pabile/p20/readme.md b/keyboards/pabile/p20/readme.md
new file mode 100644
index 000000000..256a4772e
--- /dev/null
+++ b/keyboards/pabile/p20/readme.md
@@ -0,0 +1,16 @@
1# P20
2
3![Linear grid](https://github.com/pabile/Pabile20/blob/master/_bak/layout-grid.jpg)
4![Numeric pad](https://github.com/pabile/Pabile20/blob/master/_bak/layout-numpad.jpg)
5
6A 5x4 grid keyboard with 2 rotary encoders.
7
8* Keyboard Maintainer: [pabile](https://github.com/pabile)
9* Hardware Supported: Pabile P20 PCB, Pro Micro
10* Hardware Availability: [Info at pabileonline.blogspot.com](https://pabileonline.blogspot.com/search/label/pabile20)
11
12Make example for this keyboard (after setting up your build environment):
13
14 make pabile/p20:default
15
16See 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 000000000..d4fa25323
--- /dev/null
+++ b/keyboards/pabile/p20/rules.mk
@@ -0,0 +1,37 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# ATmega32A bootloadHID
11# ATmega328P USBasp
12BOOTLOADER = caterina
13
14# Build Options
15# change yes to no to disable
16#
17BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
18MOUSEKEY_ENABLE = yes # Mouse keys
19EXTRAKEY_ENABLE = yes # Audio control and System control
20CONSOLE_ENABLE = no # Console for debug
21COMMAND_ENABLE = no # Commands for debug and configuration
22# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
23SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
24# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
25NKRO_ENABLE = no # USB Nkey Rollover
26BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
27RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
28MIDI_ENABLE = no # MIDI support
29BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
30AUDIO_ENABLE = no # Audio output on port C6
31FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
32HD44780_ENABLE = no # Enable support for HD44780 based LCDs
33UNICODE_ENABLE = yes # Unicode
34IOS_DEVICE_ENABLE = no # connect to IOS Device
35ENCODER_ENABLE = yes
36
37LAYOUTS = ortho_5x4