From ec015aa9183943c8a346f4f2b98fbc6def4f8c39 Mon Sep 17 00:00:00 2001 From: pabile <1162412+pabile@users.noreply.github.com> Date: Mon, 6 Apr 2020 18:59:27 +0800 Subject: [PATCH] Add files via upload --- keyboards/pabile/p18/config.h | 29 ++++++++++++++++ keyboards/pabile/p18/keymaps/default/keymap.c | 34 +++++++++++++++++++ keyboards/pabile/p18/p18.c | 1 + keyboards/pabile/p18/p18.h | 19 +++++++++++ keyboards/pabile/p18/rules.mk | 32 +++++++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 keyboards/pabile/p18/config.h create mode 100644 keyboards/pabile/p18/keymaps/default/keymap.c create mode 100644 keyboards/pabile/p18/p18.c create mode 100644 keyboards/pabile/p18/p18.h create mode 100644 keyboards/pabile/p18/rules.mk diff --git a/keyboards/pabile/p18/config.h b/keyboards/pabile/p18/config.h new file mode 100644 index 00000000000..73c5c906b97 --- /dev/null +++ b/keyboards/pabile/p18/config.h @@ -0,0 +1,29 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Pabile +#define PRODUCT Pabile18 +#define DESCRIPTION An 18-key DIY macropad kit + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 5 + +/* pin-out for PROMICRO */ +#define MATRIX_ROW_PINS { D1, D0, D4, C6 } +#define MATRIX_COL_PINS { D7, E6, B4, B5, D2 } +#define UNUSED_PINS + +/* Encoder position for PROMICRO */ +#define ENCODERS_PAD_A { F5, F6 } +#define ENCODERS_PAD_B { F4, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define TAPPING_TERM 200 diff --git a/keyboards/pabile/p18/keymaps/default/keymap.c b/keyboards/pabile/p18/keymaps/default/keymap.c new file mode 100644 index 00000000000..e1b71c7b5df --- /dev/null +++ b/keyboards/pabile/p18/keymaps/default/keymap.c @@ -0,0 +1,34 @@ +#include QMK_KEYBOARD_H +/* + + +enable rgb here + + +*/ + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_P7, KC_P8, KC_P9, KC_PMNS, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_A, KC_P1, KC_P2, KC_P3, KC_TAB, + KC_B, KC_DEL, KC_P0, KC_PDOT, KC_PENT) +}; + +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/p18/p18.c b/keyboards/pabile/p18/p18.c new file mode 100644 index 00000000000..94e74a83150 --- /dev/null +++ b/keyboards/pabile/p18/p18.c @@ -0,0 +1 @@ +#include "p18.h" diff --git a/keyboards/pabile/p18/p18.h b/keyboards/pabile/p18/p18.h new file mode 100644 index 00000000000..533130a4e95 --- /dev/null +++ b/keyboards/pabile/p18/p18.h @@ -0,0 +1,19 @@ +#ifndef P18_H +#define P18_H + +#include "quantum.h" + +#define LAYOUT( \ + k104, k103, k102, k101, \ + k204, k203, k202, k201, \ + k304, k303, k302, k301, k300\ + k404, k403, k402, k401, k400\ +) \ +{ \ + {k104, k103, k102, k101}, \ + {k204, k203, k202, k201}, \ + {k304, k303, k302, k301, k300}, \ + {k404, k403, k402, k401, k400} \ +} + +#endif diff --git a/keyboards/pabile/p18/rules.mk b/keyboards/pabile/p18/rules.mk new file mode 100644 index 00000000000..e0cfa26e39d --- /dev/null +++ b/keyboards/pabile/p18/rules.mk @@ -0,0 +1,32 @@ +# 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(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # 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 = yes # Enable WS2812 RGB underlight. +IOS_DEVICE_ENABLE = no # connect to IOS Device + +ENCODER_ENABLE = yes + +LAYOUTS = ortho \ No newline at end of file