diff options
Diffstat (limited to 'keyboards/bpiphany/hid_liber')
-rwxr-xr-x | keyboards/bpiphany/hid_liber/config.h | 92 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/hid_liber.c | 18 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/hid_liber.h | 70 | ||||
-rw-r--r-- | keyboards/bpiphany/hid_liber/info.json | 99 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/keymaps/bakageta/config.h | 3 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/keymaps/bakageta/keymap.c | 56 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/keymaps/bakageta/readme.md | 58 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/keymaps/bakageta/rules.mk | 33 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/keymaps/default/keymap.c | 41 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/keymaps/default/readme.md | 41 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/matrix.c | 259 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/readme.md | 17 | ||||
-rwxr-xr-x | keyboards/bpiphany/hid_liber/rules.mk | 22 |
13 files changed, 809 insertions, 0 deletions
diff --git a/keyboards/bpiphany/hid_liber/config.h b/keyboards/bpiphany/hid_liber/config.h new file mode 100755 index 0000000000..1664b9e314 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/config.h @@ -0,0 +1,92 @@ +/* Copyright 2012 Jun Wako <wakojun@gmail.com>: Original Configuration + * Copyright 2018 bakageta <amo@bakageta.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xB919 +#define DEVICE_VER 0x0001 +#define MANUFACTURER "bpiphany" +#define PRODUCT "HIDLiberation" + +/* key matrix size */ +#define MATRIX_ROWS 18 +#define MATRIX_COLS 8 + +// HID Liberation Device uses custom matrix code to accomodate a 74HC238 3 to 8 decoder on pins B1, B2 and B3. +//#define DIODE_DIRECTION + +#define LED_CAPS_LOCK_PIN B5 +#define LED_SCROLL_LOCK_PIN B6 +#define LED_PIN_ON_STATE 0 + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCE 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* disable action features */ +//#define NO_ACTION_LAYER +//#define NO_ACTION_TAPPING +//#define NO_ACTION_ONESHOT +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/bpiphany/hid_liber/hid_liber.c b/keyboards/bpiphany/hid_liber/hid_liber.c new file mode 100755 index 0000000000..2e4ddb3293 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/hid_liber.c @@ -0,0 +1,18 @@ +/* Copyright 2012 Jun Wako <wakojun@gmail.com>: LED init + * Copyright 2017 Mathias Andersson <wraul@dbox.se>: Phantom config + * Copyright 2018 bakageta <amo@bakageta.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "hid_liber.h" diff --git a/keyboards/bpiphany/hid_liber/hid_liber.h b/keyboards/bpiphany/hid_liber/hid_liber.h new file mode 100755 index 0000000000..1e2ffe3c16 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/hid_liber.h @@ -0,0 +1,70 @@ +/* Copyright 2011 Jun Wako <wakojun@gmail.com>: Original TMK layout + * Copyright 2018 bakageta <amo@bakageta.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#pragma once + +#include "quantum.h" + +#define ___ KC_NO + +/* Tenkeyless keyboard default layout, ISO & ANSI (ISO is between Left Shift + * and Z, and the ANSI \ key above Return/Enter is used for the additional ISO + * switch in the ASD row next to enter. Use NUBS as keycode for the first and + * NUHS as the keycode for the second. + * + * ,---. ,---------------. ,---------------. ,---------------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + * `---' `---------------' `---------------' `---------------' `-----------' + * ,-----------------------------------------------------------. ,-----------. + * |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + * |-----------------------------------------------------------| |-----------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + * |-----------------------------------------------------------| `-----------' + * |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| ,---. + * |Shft|ISO| Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + * |-----------------------------------------------------------| ,-----------. + * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| + * `-----------------------------------------------------------' `-----------' + */ +#define LAYOUT( \ + KG1, KH7, KJ7, KJ6, KJ1, KO5, KL1, KA6, KA7, KD7, KD5, KD1, KD2, KB5, KB3, KO3, \ + KG7, KG5, KH5, KJ5, KI5, KI7, KK7, KK5, KL5, KA5, KC5, KC7, KL7, KD6, KQ7, KN7, KM7, \ + KG6, KG3, KH3, KJ3, KI3, KI6, KK6, KK3, KL3, KA3, KC3, KC6, KL6, KD4, KP7, KN5, KM5, \ + KH6, KG4, KH4, KJ4, KI4, KI1, KK1, KK4, KL4, KA4, KC4, KC1, KD0, \ + KF6, KH1, KG0, KH0, KJ0, KI0, KI2, KK2, KK0, KL0, KA0, KC2, KF4, KN1, \ + KO7, KE6, KB1, KP1, KB2, KR4, KA2, KO0, KN2, KP2, KQ2 \ +) { \ +/* 0 1 2 3 4 5 6 7 */ \ +/* A */ { KA0 , ___ , KA2 , KA3 , KA4 , KA5 , KA6 , KA7 }, \ +/* B */ { ___ , KB1 , KB2 , KB3 , ___ , KB5 , ___ , ___ }, \ +/* C */ { ___ , KC1 , KC2 , KC3 , KC4 , KC5 , KC6 , KC7 }, \ +/* D */ { KD0 , KD1 , KD2 , ___ , KD4 , KD5 , KD6 , KD7 }, \ +/* E */ { ___ , ___ , ___ , ___ , ___ , ___ , KE6 , ___ }, \ +/* F */ { ___ , ___ , ___ , ___ , KF4 , ___ , KF6 , ___ }, \ +/* G */ { KG0 , KG1 , ___ , KG3 , KG4 , KG5 , KG6 , KG7 }, \ +/* H */ { KH0 , KH1 , ___ , KH3 , KH4 , KH5 , KH6 , KH7 }, \ +/* I */ { KI0 , KI1 , KI2 , KI3 , KI4 , KI5 , KI6 , KI7 }, \ +/* J */ { KJ0 , KJ1 , ___ , KJ3 , KJ4 , KJ5 , KJ6 , KJ7 }, \ +/* K */ { KK0 , KK1 , KK2 , KK3 , KK4 , KK5 , KK6 , KK7 }, \ +/* L */ { KL0 , KL1 , ___ , KL3 , KL4 , KL5 , KL6 , KL7 }, \ +/* M */ { ___ , ___ , ___ , ___ , ___ , KM5 , ___ , KM7 }, \ +/* N */ { ___ , KN1 , KN2 , ___ , ___ , KN5 , ___ , KN7 }, \ +/* O */ { KO0 , ___ , ___ , KO3 , ___ , KO5 , ___ , KO7 }, \ +/* P */ { ___ , KP1 , KP2 , ___ , ___ , ___ , ___ , KP7 }, \ +/* Q */ { ___ , ___ , KQ2 , ___ , ___ , ___ , ___ , KQ7 }, \ +/* R */ { ___ , ___ , ___ , ___ , KR4 , ___ , ___ , ___ } \ +} diff --git a/keyboards/bpiphany/hid_liber/info.json b/keyboards/bpiphany/hid_liber/info.json new file mode 100644 index 0000000000..9399b276c5 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/info.json @@ -0,0 +1,99 @@ +{ + "keyboard_name": "bpiphany HIDLiberation", + "url": "", + "maintainer": "qmk", + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"KG1", "x":0, "y":0}, + {"label":"KH7", "x":2, "y":0}, + {"label":"KJ7", "x":3, "y":0}, + {"label":"KJ6", "x":4, "y":0}, + {"label":"KJ1", "x":5, "y":0}, + {"label":"KO5", "x":6.5, "y":0}, + {"label":"KL1", "x":7.5, "y":0}, + {"label":"KA6", "x":8.5, "y":0}, + {"label":"KA7", "x":9.5, "y":0}, + {"label":"KD7", "x":11, "y":0}, + {"label":"KD5", "x":12, "y":0}, + {"label":"KD1", "x":13, "y":0}, + {"label":"KD2", "x":14, "y":0}, + {"label":"KB5", "x":15.25, "y":0}, + {"label":"KB3", "x":16.25, "y":0}, + {"label":"KO3", "x":17.25, "y":0}, + {"label":"KG7", "x":0, "y":1.5}, + {"label":"KG5", "x":1, "y":1.5}, + {"label":"KH5", "x":2, "y":1.5}, + {"label":"KJ5", "x":3, "y":1.5}, + {"label":"KI5", "x":4, "y":1.5}, + {"label":"KI7", "x":5, "y":1.5}, + {"label":"KK7", "x":6, "y":1.5}, + {"label":"KK5", "x":7, "y":1.5}, + {"label":"KL5", "x":8, "y":1.5}, + {"label":"KA5", "x":9, "y":1.5}, + {"label":"KC5", "x":10, "y":1.5}, + {"label":"KC7", "x":11, "y":1.5}, + {"label":"KL7", "x":12, "y":1.5}, + {"label":"KD6", "x":13, "y":1.5, "w":2}, + {"label":"KQ7", "x":15.25, "y":1.5}, + {"label":"KN7", "x":16.25, "y":1.5}, + {"label":"KM7", "x":17.25, "y":1.5}, + {"label":"KG6", "x":0, "y":2.5, "w":1.5}, + {"label":"KG3", "x":1.5, "y":2.5}, + {"label":"KH3", "x":2.5, "y":2.5}, + {"label":"KJ3", "x":3.5, "y":2.5}, + {"label":"KI3", "x":4.5, "y":2.5}, + {"label":"KI6", "x":5.5, "y":2.5}, + {"label":"KK6", "x":6.5, "y":2.5}, + {"label":"KK3", "x":7.5, "y":2.5}, + {"label":"KL3", "x":8.5, "y":2.5}, + {"label":"KA3", "x":9.5, "y":2.5}, + {"label":"KC3", "x":10.5, "y":2.5}, + {"label":"KC6", "x":11.5, "y":2.5}, + {"label":"KL6", "x":12.5, "y":2.5}, + {"label":"KD4", "x":13.5, "y":2.5, "w":1.5}, + {"label":"KP7", "x":15.25, "y":2.5}, + {"label":"KN5", "x":16.25, "y":2.5}, + {"label":"KM5", "x":17.25, "y":2.5}, + {"label":"KH6", "x":0, "y":3.5, "w":1.75}, + {"label":"KG4", "x":1.75, "y":3.5}, + {"label":"KH4", "x":2.75, "y":3.5}, + {"label":"KJ4", "x":3.75, "y":3.5}, + {"label":"KI4", "x":4.75, "y":3.5}, + {"label":"KI1", "x":5.75, "y":3.5}, + {"label":"KK1", "x":6.75, "y":3.5}, + {"label":"KK4", "x":7.75, "y":3.5}, + {"label":"KL4", "x":8.75, "y":3.5}, + {"label":"KA4", "x":9.75, "y":3.5}, + {"label":"KC4", "x":10.75, "y":3.5}, + {"label":"KC1", "x":11.75, "y":3.5}, + {"label":"KD0", "x":12.75, "y":3.5, "w":2.25}, + {"label":"KF6", "x":0, "y":4.5, "w":1.25}, + {"label":"KH1", "x":1.25, "y":4.5}, + {"label":"KG0", "x":2.25, "y":4.5}, + {"label":"KH0", "x":3.25, "y":4.5}, + {"label":"KJ0", "x":4.25, "y":4.5}, + {"label":"KI0", "x":5.25, "y":4.5}, + {"label":"KI2", "x":6.25, "y":4.5}, + {"label":"KK2", "x":7.25, "y":4.5}, + {"label":"KK0", "x":8.25, "y":4.5}, + {"label":"KL0", "x":9.25, "y":4.5}, + {"label":"KA0", "x":10.25, "y":4.5}, + {"label":"KC2", "x":11.25, "y":4.5}, + {"label":"KF4", "x":12.25, "y":4.5, "w":2.75}, + {"label":"KN1", "x":16.25, "y":4.5}, + {"label":"KO7", "x":0, "y":5.5, "w":1.25}, + {"label":"KE6", "x":1.25, "y":5.5, "w":1.25}, + {"label":"KB1", "x":2.5, "y":5.5, "w":1.25}, + {"label":"KP1", "x":3.75, "y":5.5, "w":6.25}, + {"label":"KB2", "x":10, "y":5.5, "w":1.25}, + {"label":"KR4", "x":11.25, "y":5.5, "w":1.25}, + {"label":"KA2", "x":12.5, "y":5.5, "w":1.25}, + {"label":"KO0", "x":13.75, "y":5.5, "w":1.25}, + {"label":"KN2", "x":15.25, "y":5.5}, + {"label":"KP2", "x":16.25, "y":5.5}, + {"label":"KQ2", "x":17.25, "y":5.5} + ] + } + } +} diff --git a/keyboards/bpiphany/hid_liber/keymaps/bakageta/config.h b/keyboards/bpiphany/hid_liber/keymaps/bakageta/config.h new file mode 100755 index 0000000000..b158e2d5a2 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/keymaps/bakageta/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define PERMISSIVE_HOLD diff --git a/keyboards/bpiphany/hid_liber/keymaps/bakageta/keymap.c b/keyboards/bpiphany/hid_liber/keymaps/bakageta/keymap.c new file mode 100755 index 0000000000..5fa3cf6c0a --- /dev/null +++ b/keyboards/bpiphany/hid_liber/keymaps/bakageta/keymap.c @@ -0,0 +1,56 @@ +/* Copyright 2017 Mathias Andersson <wraul@dbox.se>: Phantom Layout + * Copyright 2018 bakageta <amo@bakageta.com>: HID Liberation layouts + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "hid_liber.h" + +// Helpful defines +#define FN_CAPS LT(_FL, KC_CAPSLOCK) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _BL 0 // Base Layer +#define _GL 1 // Gaming Layer +#define _FL 2 // Function Layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = 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_BRK, \ + 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_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, \ + FN_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_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, TT(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [_GL] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [_FL] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, TO(_BL), TO(_GL), _______, _______, _______, _______, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, _______, _______, KC_VOLD, KC_MSTP, KC_VOLU, \ + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, _______, _______, KC_MNXT, KC_MPLY, KC_MNXT, \ + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, \ + _______, _______, _______, KC_P0, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/bpiphany/hid_liber/keymaps/bakageta/readme.md b/keyboards/bpiphany/hid_liber/keymaps/bakageta/readme.md new file mode 100755 index 0000000000..2b13586c0f --- /dev/null +++ b/keyboards/bpiphany/hid_liber/keymaps/bakageta/readme.md @@ -0,0 +1,58 @@ +# bakageta's Keymap for the HID Liberation Device + +A personal keymap intended for the HID Liberation Device. + +See [keymap.c](keymap.c) for details. + +## Layers + +This keymap has a base layer with combined Fn/Caps, Fn replacing APP, and an otherwise standard ANSI layout. The gaming layer blocks LGUI, and reverts caps back to a regular key for games that bind something to it. The function layer adds media keys to the nav cluster and a virtual numpad, with 1 and 2 selecting between Base and Gaming respectively. + +### Layer 1: Base Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + |-----------------------------------------------------------| |-----------| + |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + |-----------------------------------------------------------| '-----------' + |Fn/Cps| A| S| D| F| G| H| J| K| L| ;| '|Return | + |-----------------------------------------------------------| ,---. + |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + |-----------------------------------------------------------| ,-----------. + |Ctl|Gui|Alt| Space |Alt|Gui|Fn |Ctl| |Lef|Dow|Rig| + `-----------------------------------------------------------' `-----------' + +### Layer 2: Gaming Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + | | | | | | | | | | | | | | | | | | | | | + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| '-----------' + | Caps | | | | | | | | | | | | | + |-----------------------------------------------------------| ,---. + | | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | |XXX| | | | | | | | | | | + `-----------------------------------------------------------' `-----------' + + +### Layer 3: Function Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + | | | | | | | | | | | | | | | | | | | | | + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | BL| GL| | | | | | | | | | | | |Vo-|Stp|Vo+| + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | |Prv|Ply|Nxt| + |-----------------------------------------------------------| '-----------' + | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,---. + | | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | | | | | | | | | | | | | + `-----------------------------------------------------------' `-----------' diff --git a/keyboards/bpiphany/hid_liber/keymaps/bakageta/rules.mk b/keyboards/bpiphany/hid_liber/keymaps/bakageta/rules.mk new file mode 100755 index 0000000000..b1530f614f --- /dev/null +++ b/keyboards/bpiphany/hid_liber/keymaps/bakageta/rules.mk @@ -0,0 +1,33 @@ +# Copyright 2013 Jun Wako <wakojun@gmail.com> +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + + +# QMK 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 = yes # Enable Bootmagic Lite +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 +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 = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
\ No newline at end of file diff --git a/keyboards/bpiphany/hid_liber/keymaps/default/keymap.c b/keyboards/bpiphany/hid_liber/keymaps/default/keymap.c new file mode 100755 index 0000000000..60ff8d11b0 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/keymaps/default/keymap.c @@ -0,0 +1,41 @@ +/* Copyright 2017 Mathias Andersson <wraul@dbox.se>: Phantom Layout + * Copyright 2018 bakageta <amo@bakageta.com>: HID Liberation layouts + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include QMK_KEYBOARD_H + +enum layer_names { + _BL, // Base Layer + _FL, // Media Layer +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = 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_BRK, + 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_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_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_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + [_FL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_MSTP, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_MPLY, KC_MNXT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; diff --git a/keyboards/bpiphany/hid_liber/keymaps/default/readme.md b/keyboards/bpiphany/hid_liber/keymaps/default/readme.md new file mode 100755 index 0000000000..2bae07e548 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/keymaps/default/readme.md @@ -0,0 +1,41 @@ +# The default keymap for the HID Liberation Device + +A basic keymap intended for the HID Liberation Device using the standard ANSI layout. + +See [keymap.c](keymap.c) for details. + +## Layers + +This keymap has two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key. + +### Layer 1: Base Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + |~ | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | |Ins|Hom|PgU| + |-----------------------------------------------------------| |-----------| + |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| + |-----------------------------------------------------------| '-----------' + |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return | + |-----------------------------------------------------------| ,---. + |Sft |ISO| Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | + |-----------------------------------------------------------| ,-----------. + |Ctl |Gui |Alt | Space |Alt |Gui |Fn |Ctl | |Lef|Dow|Rig| + `-----------------------------------------------------------' `-----------' + +### Layer 2: Media Layer + ,---. ,---------------. ,---------------. ,---------------. ,-----------. + | | | | | | | | | | | | | | | | | | | | | + `---' `---------------' `---------------' `---------------' `-----------' + ,-----------------------------------------------------------. ,-----------. + | | | | | | | | | | | | | | | |Vo-|Stp|Vo+| + |-----------------------------------------------------------| |-----------| + | | | | | | | | | | | | | | | |Prv|Ply|Nxt| + |-----------------------------------------------------------| '-----------' + | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,---. + | | | | | | | | | | | | | | | | + |-----------------------------------------------------------| ,-----------. + | | | | | | | | | | | | | + `-----------------------------------------------------------' `-----------' diff --git a/keyboards/bpiphany/hid_liber/matrix.c b/keyboards/bpiphany/hid_liber/matrix.c new file mode 100755 index 0000000000..da73c616d7 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/matrix.c @@ -0,0 +1,259 @@ +/* Copyright 2012 Jun Wako <wakojun@gmail.com>: TMK Matrix + * Copyright 2018 bakageta <amo@bakageta.com> + * + * This is heavily based on hid_liber/board.{c|h}. + * https://github.com/BathroomEpiphanies/AVR-Keyboard + * + * Copyright (c) 2012 Fredrik Atmer, Bathroom Epiphanies Inc + * http://bathroomepiphanies.com + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <stdint.h> +#include <stdbool.h> +#if defined(__AVR__) +#include <avr/io.h> +#endif +#include <util/delay.h> +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +// bit array of key state(1:on, 0:off) +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + + +#define _DDRA (uint8_t *const)&DDRA +#define _DDRB (uint8_t *const)&DDRB +#define _DDRC (uint8_t *const)&DDRC +#define _DDRD (uint8_t *const)&DDRD +#define _DDRE (uint8_t *const)&DDRE +#define _DDRF (uint8_t *const)&DDRF + +#define _PINA (uint8_t *const)&PINA +#define _PINB (uint8_t *const)&PINB +#define _PINC (uint8_t *const)&PINC +#define _PIND (uint8_t *const)&PIND +#define _PINE (uint8_t *const)&PINE +#define _PINF (uint8_t *const)&PINF + +#define _PORTA (uint8_t *const)&PORTA +#define _PORTB (uint8_t *const)&PORTB +#define _PORTC (uint8_t *const)&PORTC +#define _PORTD (uint8_t *const)&PORTD +#define _PORTE (uint8_t *const)&PORTE +#define _PORTF (uint8_t *const)&PORTF + +#define _BIT0 0x01 +#define _BIT1 0x02 +#define _BIT2 0x04 +#define _BIT3 0x08 +#define _BIT4 0x10 +#define _BIT5 0x20 +#define _BIT6 0x40 +#define _BIT7 0x80 + +/* Specifies the ports and pin numbers for the rows */ +static +uint8_t *const row_ddr[MATRIX_ROWS] = { + _DDRB, _DDRB, + _DDRC, _DDRC, + _DDRD, _DDRD, _DDRD, _DDRD, _DDRD, _DDRD, _DDRD, _DDRD, + _DDRF, _DDRF, _DDRF, _DDRF, _DDRF, _DDRF}; + +static +uint8_t *const row_port[MATRIX_ROWS] = { + _PORTB, _PORTB, + _PORTC, _PORTC, + _PORTD, _PORTD, _PORTD, _PORTD, _PORTD, _PORTD, _PORTD, _PORTD, + _PORTF, _PORTF, _PORTF, _PORTF, _PORTF, _PORTF}; + +static +uint8_t *const row_pin[MATRIX_ROWS] = { + _PINB, _PINB, + _PINC, _PINC, + _PIND, _PIND, _PIND, _PIND, _PIND, _PIND, _PIND, _PIND, + _PINF, _PINF, _PINF, _PINF, _PINF, _PINF}; + +static +const uint8_t row_bit[MATRIX_ROWS] = { + _BIT4, _BIT7, + _BIT6, _BIT7, + _BIT0, _BIT1, _BIT2, _BIT3, _BIT4, _BIT5, _BIT6, _BIT7, + _BIT0, _BIT1, _BIT4, _BIT5, _BIT6, _BIT7}; + +static +const uint8_t mask = 0x0E; + +/* Specifies the ports and pin numbers for the columns */ +static +const uint8_t col_bit[MATRIX_COLS] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E}; + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +static +inline void pull_column(int col) { + PORTB = col_bit[col] | (PORTB & ~mask); +} + +static +inline void release_column(int col) { +} + +/* PORTB is set as input with pull-up resistors + PORTC,D,E,F are set to high output */ +static +void setup_io_pins(void) { + uint8_t row; + DDRB |= 0x0E; + PORTB &= ~0x0E; + for(row = 0; row < MATRIX_ROWS; row++) { + *row_ddr[row] &= ~row_bit[row]; + *row_port[row] &= ~row_bit[row]; + } +} + +static +void setup_leds(void) { + DDRB |= 0x60; + PORTB |= 0x60; +} + + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + // initialize row and col + setup_io_pins(); + setup_leds(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) +{ + for (uint8_t col = 0; col < MATRIX_COLS; col++) { // 0-7 + pull_column(col); // output hi on theline + _delay_us(5); // without this wait it won't read stable value. + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { // 0-17 + bool prev_bit = matrix_debouncing[row] & (1<<col); + bool curr_bit = *row_pin[row] & row_bit[row]; + if (prev_bit != curr_bit) { + matrix_debouncing[row] ^= ((matrix_row_t)1<<col); + if (debouncing) { + dprintf("bounce!: %02X\n", debouncing); + } + debouncing = DEBOUNCE; + } + } + release_column(col); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + matrix_scan_quantum(); + return 1; +} + +inline +bool matrix_has_ghost(void) +{ + return false; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<<col)); +} + +inline +matrix_row_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +void matrix_print(void) +{ + print("\nr/c 01234567\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + print_hex8(row); print(": "); + print_bin_reverse8(matrix_get_row(row)); + print("\n"); + } +} + +uint8_t matrix_key_count(void) +{ + uint8_t count = 0; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + for (uint8_t j = 0; j < MATRIX_COLS; j++) { + if (matrix_is_on(i, j)) + count++; + } + } + return count; +} diff --git a/keyboards/bpiphany/hid_liber/readme.md b/keyboards/bpiphany/hid_liber/readme.md new file mode 100755 index 0000000000..3f653cc040 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/readme.md @@ -0,0 +1,17 @@ +# HID Liberation Device + +DIY daughterboard for Filco Majestouch TKL developed by Geekhack and Deskthority communities. The PCB was engineered by bpiphany. + +## Wiki on Deskthority.net +- [Instructions](http://deskthority.net/wiki/HID_Liberation_Device_-_Instructions) +- [Assembly Instructions](http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions) + +* Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +* Hardware Supported: HID Liberation Device (ATmega32U4) +* Hardware Availability: Discontinued + +Make example for this keyboard (after setting up your build environment): + + make bpiphany/hid_liber: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/bpiphany/hid_liber/rules.mk b/keyboards/bpiphany/hid_liber/rules.mk new file mode 100755 index 0000000000..ecdc53dad1 --- /dev/null +++ b/keyboards/bpiphany/hid_liber/rules.mk @@ -0,0 +1,22 @@ +# MCU name +MCU = atmega32u4 + +# Bootloader selection +BOOTLOADER = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +CUSTOM_MATRIX = yes # Custom matrix file +NKRO_ENABLE = yes # Enable N-Key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +AUDIO_ENABLE = no # Audio output + +# Project specific files +SRC = matrix.c |