aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames <32029516+broken-username@users.noreply.github.com>2017-10-21 14:04:35 -0600
committerJack Humbert <jack.humb@gmail.com>2017-10-21 10:04:35 -1000
commitab3dbd8daad0554104862f97e33291973bbef7ed (patch)
tree616492583d13c4238037ec798cdc8128d0ebad12
parent1954ad1fd88dd2fb55041e722eaa64922b06e30a (diff)
downloadqmk_firmware-ab3dbd8daad0554104862f97e33291973bbef7ed.tar.gz
qmk_firmware-ab3dbd8daad0554104862f97e33291973bbef7ed.zip
Additional custom handwired layout - Space Oddity (#1868)
* Add existing file * Add new keyboard layout - initial commit * Revised readme.md * Clarified readme.md, reorganized keymap.c, and added license text. * Fixing last incomplete commit * Just a little code cleanup to make things more readable.
-rw-r--r--keyboards/handwired/space_oddity/config.h66
-rw-r--r--keyboards/handwired/space_oddity/keymaps/default/keymap.c156
-rw-r--r--keyboards/handwired/space_oddity/readme.md25
-rw-r--r--keyboards/handwired/space_oddity/rules.mk57
-rw-r--r--keyboards/handwired/space_oddity/space_oddity.c1
-rw-r--r--keyboards/handwired/space_oddity/space_oddity.h22
6 files changed, 327 insertions, 0 deletions
diff --git a/keyboards/handwired/space_oddity/config.h b/keyboards/handwired/space_oddity/config.h
new file mode 100644
index 000000000..88cc5ad00
--- /dev/null
+++ b/keyboards/handwired/space_oddity/config.h
@@ -0,0 +1,66 @@
1#ifndef CONFIG_H
2#define CONFIG_H
3
4#include "config_common.h"
5
6/* USB Device descriptor parameter */
7#define VENDOR_ID 0xFEED
8#define PRODUCT_ID 0x6060
9#define DEVICE_VER 0x0001
10#define MANUFACTURER James Taylor
11#define PRODUCT Space Odyssey
12#define DESCRIPTION Keyboard
13
14#define CATERINA_BOOTLOADER
15
16#define MOUSEKEY_INTERVAL 16
17#define MOUSEKEY_DELAY 0
18#define MOUSEKEY_TIME_TO_MAX 60
19#define MOUSEKEY_MAX_SPEED 7
20#define MOUSEKEY_WHEEL_DELAY 0
21
22/* key matrix size */
23#define MATRIX_ROWS 6
24#define MATRIX_COLS 12
25
26/* key matrix pins */
27#define MATRIX_ROW_PINS { F4, F5, F6, F7, B1, B3 }
28#define MATRIX_COL_PINS { B2, B6, B5, B4, E6, D7, C6, D4, D0, D1, D2, D3 }
29#define UNUSED_PINS
30
31/* COL2ROW or ROW2COL */
32#define DIODE_DIRECTION COL2ROW
33
34/* number of backlight levels */
35
36#ifdef BACKLIGHT_PIN
37#define BACKLIGHT_LEVELS 0
38#endif
39
40/* Set 0 if debouncing isn't needed */
41#define DEBOUNCING_DELAY 5
42
43/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
44#define LOCKING_SUPPORT_ENABLE
45
46/* Locking resynchronize hack */
47#define LOCKING_RESYNC_ENABLE
48
49/* key combination for command */
50#define IS_COMMAND() ( \
51 keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
52)
53
54/* prevent stuck modifiers */
55#define PREVENT_STUCK_MODIFIERS
56
57
58#ifdef RGB_DI_PIN
59#define RGBLIGHT_ANIMATIONS
60#define RGBLED_NUM 0
61#define RGBLIGHT_HUE_STEP 8
62#define RGBLIGHT_SAT_STEP 8
63#define RGBLIGHT_VAL_STEP 8
64#endif
65
66#endif
diff --git a/keyboards/handwired/space_oddity/keymaps/default/keymap.c b/keyboards/handwired/space_oddity/keymaps/default/keymap.c
new file mode 100644
index 000000000..26be16fbd
--- /dev/null
+++ b/keyboards/handwired/space_oddity/keymaps/default/keymap.c
@@ -0,0 +1,156 @@
1/* Keymap for Space Oddity Keyboard
2 Copyright (C) 2017 James Taylor
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>.
16*/
17
18#include "space_oddity.h"
19
20// Planck keycodes needed for dynamic macros
21enum planck_keycodes {
22
23 QWERTY = SAFE_RANGE,
24 DYNAMIC_MACRO_RANGE,
25
26};
27
28// Tap Dance
29enum {
30
31 SFT_CAPS = 0,
32
33};
34
35#include "dynamic_macro.h"
36
37#define MOUSE_LAYER 2
38
39const uint16_t PROGMEM fn_actions[] = {
40
41 [2] = ACTION_LAYER_TOGGLE(MOUSE_LAYER),
42
43};
44
45qk_tap_dance_action_t tap_dance_actions[] = {
46
47 [SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
48
49};
50
51const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
52
53 KEYMAP(
54 M(0), M(1), M(2), M(3), M(4), DYN_MACRO_PLAY1, DYN_MACRO_PLAY2,
55 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
56 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
57 CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
58 TD(SFT_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT),
59 MO(2), MO(1), KC_LGUI, KC_RALT, KC_LCTRL, KC_SPC, ALT_T(KC_LEFT), ALL_T(KC_RGHT), LT(1, KC_UP), LT(2, KC_DOWN)),
60
61 KEYMAP(
62 M(7), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DYN_REC_START1, DYN_REC_START2,
63 DYN_REC_STOP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LBRC, KC_P7, KC_P8, KC_P9, KC_ASTR, KC_DEL,
64 KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_EQL,
65 KC_BSLS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LCBR, KC_P1, KC_P2, KC_P3, KC_MINS, KC_PIPE,
66 KC_TRNS, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_RCBR, KC_P0, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS,
67 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
68
69 KEYMAP(
70 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
71 KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
72 KC_TRNS, KC_TRNS, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_BTN3, KC_MS_BTN2, KC_TRNS, KC_TRNS,
73 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
74 KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
75 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, F(2))
76};
77
78const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
79
80 switch (id) {
81 case 0:
82 if (record->event.pressed) {
83 SEND_STRING("()"SS_TAP(X_LEFT));
84 }
85 break;
86
87 case 1:
88 if (record->event.pressed) {
89 SEND_STRING("[]"SS_TAP(X_LEFT));
90 }
91 break;
92
93 case 2:
94 if (record->event.pressed) {
95 SEND_STRING("{}"SS_TAP(X_LEFT));
96 }
97 break;
98
99 case 7:
100 if (record->event.pressed) {
101 SEND_STRING("(lambda ())"SS_TAP(X_LEFT)SS_TAP(X_LEFT));
102 }
103 break;
104 }
105
106 return MACRO_NONE;
107
108}
109
110void matrix_init_user(void) {
111}
112
113void matrix_scan_user(void) {
114}
115
116bool process_record_user(uint16_t keycode, keyrecord_t *record) {
117
118 if (!process_record_dynamic_macro(keycode, record)) {
119 return false;
120 }
121 return true;
122}
123
124void led_set_user(uint8_t usb_led) {
125
126 if (usb_led & (1 << USB_LED_NUM_LOCK)) {
127
128 } else {
129
130 }
131
132 if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
133
134 } else {
135
136 }
137
138 if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
139
140 } else {
141
142 }
143
144 if (usb_led & (1 << USB_LED_COMPOSE)) {
145
146 } else {
147
148 }
149
150 if (usb_led & (1 << USB_LED_KANA)) {
151
152 } else {
153
154 }
155
156}
diff --git a/keyboards/handwired/space_oddity/readme.md b/keyboards/handwired/space_oddity/readme.md
new file mode 100644
index 000000000..1dadcb8a9
--- /dev/null
+++ b/keyboards/handwired/space_oddity/readme.md
@@ -0,0 +1,25 @@
1Space Oddity Keyboard
2=====================
3
4This firmware is for an Emacs-focused handwired custom keyboard using an Arduino Pro Micro.
5
6As originally designed, the top row consists of 2u keys which are used for user-defined macros. The keys for Shift and Enter are 1.75u.
7
8Some simple example macros are included. To add your own, simply add the number of the macro you want in the appropriate section.
9
10A picture of the finished product can be found here: https://imgur.com/dE9Y4XK
11
12## Pinout
13
14The following pins are used:
15- Columns 1-12: B2, B6, B5, B4, E6, D7, C6, D4, D0, D1, D2, D3
16- Rows 1-6: F4, F5, F6, F7, B1, B3
17
18## Compiling and loading the firmware
19
20To build the firmware, run `make handwired/space-oddity` from the toplevel directory.
21
22On GNU/Linux, you can flash the default layout onto the microcontroller by using `avrdude -p atmega32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:handwired_space_oddity_default.hex`. Note that the device name under `/dev` may be different.
23
24
25This design was conceived by James Taylor. Any requests for further information and/or tips for building your own are welcome! \ No newline at end of file
diff --git a/keyboards/handwired/space_oddity/rules.mk b/keyboards/handwired/space_oddity/rules.mk
new file mode 100644
index 000000000..170c64a30
--- /dev/null
+++ b/keyboards/handwired/space_oddity/rules.mk
@@ -0,0 +1,57 @@
1# MCU name
2MCU = atmega32u4
3
4# Processor frequency.
5# This will define a symbol, F_CPU, in all source code files equal to the
6# processor frequency in Hz. You can then use this symbol in your source code to
7# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
8# automatically to create a 32-bit value in your source code.
9#
10# This will be an integer division of F_USB below, as it is sourced by
11# F_USB after it has run through any CPU prescalers. Note that this value
12# does not *change* the processor frequency - it should merely be updated to
13# reflect the processor speed set externally so that the code can use accurate
14# software delays.
15F_CPU = 16000000
16
17#
18# LUFA specific
19#
20# Target architecture (see library "Board Types" documentation).
21ARCH = AVR8
22
23# Input clock frequency.
24# This will define a symbol, F_USB, in all source code files equal to the
25# input clock frequency (before any prescaling is performed) in Hz. This value may
26# differ from F_CPU if prescaling is used on the latter, and is required as the
27# raw input clock is fed directly to the PLL sections of the AVR for high speed
28# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
29# at the end, this will be done automatically to create a 32-bit value in your
30# source code.
31#
32# If no clock division is performed on the input clock inside the AVR (via the
33# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
34F_USB = $(F_CPU)
35
36# Interrupt driven control endpoint task(+60)
37OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
38
39
40# Boot Section Size in *bytes*
41OPT_DEFS += -DBOOTLOADER_SIZE=4096
42
43
44# Build Options
45# comment out to disable the options.
46#
47BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
48MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
49EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
50CONSOLE_ENABLE ?= no # Console for debug(+400)
51COMMAND_ENABLE ?= no # Commands for debug and configuration
52SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
53NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
54BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality
55AUDIO_ENABLE ?= no
56RGBLIGHT_ENABLE ?= no
57TAP_DANCE_ENABLE = yes
diff --git a/keyboards/handwired/space_oddity/space_oddity.c b/keyboards/handwired/space_oddity/space_oddity.c
new file mode 100644
index 000000000..9a9a270a4
--- /dev/null
+++ b/keyboards/handwired/space_oddity/space_oddity.c
@@ -0,0 +1 @@
#include "space_oddity.h"
diff --git a/keyboards/handwired/space_oddity/space_oddity.h b/keyboards/handwired/space_oddity/space_oddity.h
new file mode 100644
index 000000000..e9270d044
--- /dev/null
+++ b/keyboards/handwired/space_oddity/space_oddity.h
@@ -0,0 +1,22 @@
1#ifndef KB_H
2#define KB_H
3
4#include "quantum.h"
5
6#define KEYMAP( \
7 K000, K002, K004, K006, K008, K010, K011, \
8 K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
9 K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
10 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, \
11 K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, \
12 K500, K501, K502, K503, K505, K507, K508, K509, K510, K511 \
13) { \
14 { K000, KC_NO, K002, KC_NO, K004, KC_NO, K006, KC_NO, K008, KC_NO, K010, K011 }, \
15 { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \
16 { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \
17 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \
18 { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 }, \
19 { K500, K501, K502, K503, KC_NO, K505, KC_NO, K507, K508, K509, K510, K511 } \
20}
21
22#endif \ No newline at end of file