From d85afffa434c1610372a84fc0c596a88836e4d53 Mon Sep 17 00:00:00 2001 From: Michael Kemp <20897849+mkem114@users.noreply.github.com> Date: Wed, 21 Nov 2018 07:11:23 +1300 Subject: [PATCH] Keyboard: Add Handwired 108 Key with Trackpoint (#4448) * Include both base keyboards * Merge the keymap * Merge the configs * Add wiring diagram for clarity of documentation * Merge rules * Merge keyboard sources * Change names to compile * Update documentation to suit * Add qwerty layout to 108keyTrackpoint * Separate the dvorak standard layout from a media focused one * Update documentation to reflect new keymaps * [style] Add empty lines at ends of files * [style] Meet current QMK style guide * Bring READEME closer to the QMK template * [style] Change all "108keyTrackpoint" to "108key_trackpoint" * [style] Use "LAYOUT" instead of "KEYMAP" QMK terminology has changed Co-Authored-By: mkem114 <20897849+mkem114@users.noreply.github.com> * Add two spaces after maintainer in README This is required to render properly Co-Authored-By: mkem114 <20897849+mkem114@users.noreply.github.com> * Remove redundant line "PREVENT_STUCK_MODIFIERS" is default on for QMK Co-Authored-By: mkem114 <20897849+mkem114@users.noreply.github.com> * Change include of keymaps to use QMK_KEYBOARD_H This includes automatically * Update make rules to match template * Change from KC_MENU to KC_APP The button functionality actually wanted is the context menu key * [style] Change "dvorakMedia" to "dvorak_media" * Update README to reflect minor changes --- .../108key_trackpoint/108key_trackpoint.c | 1 + .../108key_trackpoint/108key_trackpoint.h | 23 ++++++ .../handwired/108key_trackpoint/README.md | 23 ++++++ .../handwired/108key_trackpoint/config.h | 73 +++++++++++++++++ .../keymaps/default/keymap.c | 14 ++++ .../108key_trackpoint/keymaps/dvorak/keymap.c | 14 ++++ .../keymaps/dvorak_media/keymap.c | 14 ++++ .../handwired/108key_trackpoint/rules.mk | 82 +++++++++++++++++++ 8 files changed, 244 insertions(+) create mode 100644 keyboards/handwired/108key_trackpoint/108key_trackpoint.c create mode 100644 keyboards/handwired/108key_trackpoint/108key_trackpoint.h create mode 100644 keyboards/handwired/108key_trackpoint/README.md create mode 100644 keyboards/handwired/108key_trackpoint/config.h create mode 100644 keyboards/handwired/108key_trackpoint/keymaps/default/keymap.c create mode 100644 keyboards/handwired/108key_trackpoint/keymaps/dvorak/keymap.c create mode 100644 keyboards/handwired/108key_trackpoint/keymaps/dvorak_media/keymap.c create mode 100644 keyboards/handwired/108key_trackpoint/rules.mk diff --git a/keyboards/handwired/108key_trackpoint/108key_trackpoint.c b/keyboards/handwired/108key_trackpoint/108key_trackpoint.c new file mode 100644 index 000000000000..3834f89613f0 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/108key_trackpoint.c @@ -0,0 +1 @@ +#include "108key_trackpoint.h" diff --git a/keyboards/handwired/108key_trackpoint/108key_trackpoint.h b/keyboards/handwired/108key_trackpoint/108key_trackpoint.h new file mode 100644 index 000000000000..100f4cb93284 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/108key_trackpoint.h @@ -0,0 +1,23 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K002, K003, K004, K005, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K019, K020, K021, K022, \ + \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, K217, K219, K220, K221, K222, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K319, K320, K321, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K419, K420, K421, K422, \ + K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K513, K516, K519, K520, K521, \ + K600, K601, K603, K606, K610, K611, K613, K614, K615, K616, K617, K619, K621, K622, \ + K705, K706, K707 \ +) { \ + { K000, KC_NO, K002, K003, K004, K005, KC_NO, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, KC_NO, K019, K020, K021, K022 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214, K215, K216, K217, KC_NO, K219, K220, K221, K222 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, KC_NO, K319, K320, K321, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K419, K420, K421, K422 }, \ + { KC_NO, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, KC_NO, K513, KC_NO, KC_NO, K516, KC_NO, KC_NO, K519, K520, K521, KC_NO }, \ + { K600, K601, KC_NO, K603, KC_NO, KC_NO, K606, KC_NO, KC_NO, KC_NO, K610, K611, KC_NO, K613, K614, K615, K616, K617, KC_NO, K619, KC_NO, K621, K622 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K705, K706, K707, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} diff --git a/keyboards/handwired/108key_trackpoint/README.md b/keyboards/handwired/108key_trackpoint/README.md new file mode 100644 index 000000000000..247043e1711d --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/README.md @@ -0,0 +1,23 @@ +# 108 Key with TrackPoint + +![wiring](https://raw.githubusercontent.com/qmk/qmk.fm/gh-pages/keyboards/handwired/108key_trackpoint/wiring.JPG) + +This is based off the handwired/trackpoint keyboard and generated code from [Keyboard Firmware Builder](https://kbfirmware.com/). + +Keyboard Maintainer: [mkem114](https://github.com/mkem114) +Hardware Supported (tested): Teensy++ 2.0 + +Make example for this keyboard (after setting up your build environment): + + make handwired/108keyTrackpoint: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). + +You may have to modify the source code to suit 104 keys, RGB back-lights, different micro-controllers, or big ass enter. + +There are three keymaps: +* qwerty with the four extra keys being: mute, media prev, media next, and media play +* dvorak with the four extra keys being: mute, media prev, media next, and media play +* dvorak_media with the caps lock being media play and the four extra keys being: mute, volume down, volume up, and media next + +To figure out how to wire your specific TrackPoint have a look out: [How to integrate a trackpoint in a mechanical keyboard](https://github.com/alonswartz/trackpoint). diff --git a/keyboards/handwired/108key_trackpoint/config.h b/keyboards/handwired/108key_trackpoint/config.h new file mode 100644 index 000000000000..7a63fe262861 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/config.h @@ -0,0 +1,73 @@ +#pragma once + +#include "config_common.h" + +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x5678 +#define DEVICE_VER 0x0001 +#define MANUFACTURER QMK +#define PRODUCT 108Key-Trackpoint +#define DESCRIPTION A 108 key ANSI keyboard with a trackpoint and three mouse buttons + +#define MATRIX_ROWS 8 +#define MATRIX_COLS 23 + +#ifdef PS2_USE_USART + #define PS2_CLOCK_PORT PORTD + #define PS2_CLOCK_PIN PIND + #define PS2_CLOCK_DDR DDRD + #define PS2_CLOCK_BIT 5 + #define PS2_DATA_PORT PORTD + #define PS2_DATA_PIN PIND + #define PS2_DATA_DDR DDRD + #define PS2_DATA_BIT 2 + + /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ + /* set DDR of CLOCK as input to be slave */ + #define PS2_USART_INIT() do { \ + PS2_CLOCK_DDR &= ~(1<mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + diff --git a/keyboards/handwired/108key_trackpoint/keymaps/default/keymap.c b/keyboards/handwired/108key_trackpoint/keymaps/default/keymap.c new file mode 100644 index 000000000000..3345aca16977 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/keymaps/default/keymap.c @@ -0,0 +1,14 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT ( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_MUTE, KC_MPRV, KC_MNXT, KC_MPLY, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_UP, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_APP, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, + KC_BTN1, KC_BTN3, KC_BTN2 + ) +}; diff --git a/keyboards/handwired/108key_trackpoint/keymaps/dvorak/keymap.c b/keyboards/handwired/108key_trackpoint/keymaps/dvorak/keymap.c new file mode 100644 index 000000000000..0181ad9f77b9 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/keymaps/dvorak/keymap.c @@ -0,0 +1,14 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT ( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_MUTE, KC_MPRV, KC_MNXT, KC_MPLY, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, + KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LSFT, KC_UP, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_APP, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, + KC_BTN1, KC_BTN3, KC_BTN2 + ) +}; diff --git a/keyboards/handwired/108key_trackpoint/keymaps/dvorak_media/keymap.c b/keyboards/handwired/108key_trackpoint/keymaps/dvorak_media/keymap.c new file mode 100644 index 000000000000..d6223c496eb7 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/keymaps/dvorak_media/keymap.c @@ -0,0 +1,14 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT ( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, + + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, + KC_MPLY, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LSFT, KC_UP, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI, KC_APP, KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, + KC_BTN1, KC_BTN3, KC_BTN2 + ) +}; diff --git a/keyboards/handwired/108key_trackpoint/rules.mk b/keyboards/handwired/108key_trackpoint/rules.mk new file mode 100644 index 000000000000..84ec52eee9f2 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/rules.mk @@ -0,0 +1,82 @@ +# MCU name +MCU = at90usb1286 +#MCU = atmega32u4 + +# Processor frequency. +# This will define a symbol, F_CPU, in all source code files equal to the +# processor frequency in Hz. You can then use this symbol in your source code to +# calculate timings. Do NOT tack on a 'UL' at the end, this will be done +# automatically to create a 32-bit value in your source code. +# +# This will be an integer division of F_USB below, as it is sourced by +# F_USB after it has run through any CPU prescalers. Note that this value +# does not *change* the processor frequency - it should merely be updated to +# reflect the processor speed set externally so that the code can use accurate +# software delays. +F_CPU = 16000000 + + +# +# LUFA specific +# +# Target architecture (see library "Board Types" documentation). +ARCH = AVR8 + +# Input clock frequency. +# This will define a symbol, F_USB, in all source code files equal to the +# input clock frequency (before any prescaling is performed) in Hz. This value may +# differ from F_CPU if prescaling is used on the latter, and is required as the +# raw input clock is fed directly to the PLL sections of the AVR for high speed +# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' +# at the end, this will be done automatically to create a 32-bit value in your +# source code. +# +# If no clock division is performed on the input clock inside the AVR (via the +# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. +F_USB = $(F_CPU) + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = halfkay + + +# If you don't know the bootloader type, then you can specify the +# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# change yes to no to disable +# +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 = yes # Console for debug(+400) +COMMAND_ENABLE = yes # 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 = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +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 (+400) +PS2_MOUSE_ENABLE = yes +PS2_USE_USART = yes