diff options
| author | Erovia <Erovia@users.noreply.github.com> | 2019-01-14 09:49:00 +0100 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2019-01-14 00:49:00 -0800 |
| commit | ee96b7a89dd2de78b9372d3b8ce899757e3190c4 (patch) | |
| tree | f347cd4526f49d3373d1f7ab14d3d2989cc8b95b | |
| parent | 929065b1a97eb15a54a65c866d19d45998f775c6 (diff) | |
| download | qmk_firmware-ee96b7a89dd2de78b9372d3b8ce899757e3190c4.tar.gz qmk_firmware-ee96b7a89dd2de78b9372d3b8ce899757e3190c4.zip | |
[Keyboard] Add support for THE50 (#4844)
* Add support for THE50
A 50% custom keyboard designed and produced by LazyDesigners
* THE50 code-improvement
Implement the changes suggested by noroadsleft.
| -rw-r--r-- | keyboards/lazydesigners/the50/config.h | 49 | ||||
| -rw-r--r-- | keyboards/lazydesigners/the50/info.json | 67 | ||||
| -rw-r--r-- | keyboards/lazydesigners/the50/keymaps/default/keymap.c | 59 | ||||
| -rw-r--r-- | keyboards/lazydesigners/the50/keymaps/default/readme.md | 31 | ||||
| -rw-r--r-- | keyboards/lazydesigners/the50/readme.md | 17 | ||||
| -rw-r--r-- | keyboards/lazydesigners/the50/rules.mk | 52 | ||||
| -rw-r--r-- | keyboards/lazydesigners/the50/the50.c | 9 | ||||
| -rw-r--r-- | keyboards/lazydesigners/the50/the50.h | 32 |
8 files changed, 316 insertions, 0 deletions
diff --git a/keyboards/lazydesigners/the50/config.h b/keyboards/lazydesigners/the50/config.h new file mode 100644 index 000000000..e4f91f5ee --- /dev/null +++ b/keyboards/lazydesigners/the50/config.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "config_common.h" | ||
| 4 | |||
| 5 | /* USB Device descriptor parameter */ | ||
| 6 | #define VENDOR_ID 0xFEED | ||
| 7 | #define PRODUCT_ID 0x0050 | ||
| 8 | #define DEVICE_VER 0x0001 | ||
| 9 | #define MANUFACTURER LazyDesigners | ||
| 10 | #define PRODUCT THE50 | ||
| 11 | #define DESCRIPTION A 50% keyboard | ||
| 12 | |||
| 13 | /* key matrix size */ | ||
| 14 | #define MATRIX_ROWS 4 | ||
| 15 | #define MATRIX_COLS 15 | ||
| 16 | |||
| 17 | /* key matrix pins */ | ||
| 18 | #define MATRIX_ROW_PINS { B0, B1, B2, B3 } | ||
| 19 | #define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } | ||
| 20 | #define UNUSED_PINS | ||
| 21 | |||
| 22 | /* COL2ROW or ROW2COL */ | ||
| 23 | #define DIODE_DIRECTION COL2ROW | ||
| 24 | |||
| 25 | /* number of backlight levels */ | ||
| 26 | #define BACKLIGHT_PIN B6 | ||
| 27 | #ifdef BACKLIGHT_PIN | ||
| 28 | #define BACKLIGHT_LEVELS 6 | ||
| 29 | #endif | ||
| 30 | |||
| 31 | /* Set 0 if debouncing isn't needed */ | ||
| 32 | #define DEBOUNCING_DELAY 5 | ||
| 33 | |||
| 34 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
| 35 | #define LOCKING_SUPPORT_ENABLE | ||
| 36 | |||
| 37 | /* Locking resynchronize hack */ | ||
| 38 | #define LOCKING_RESYNC_ENABLE | ||
| 39 | |||
| 40 | /* key combination for command */ | ||
| 41 | #define IS_COMMAND() ( \ | ||
| 42 | keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ | ||
| 43 | ) | ||
| 44 | |||
| 45 | #define RGB_DI_PIN E6 | ||
| 46 | #ifdef RGB_DI_PIN | ||
| 47 | #define RGBLED_NUM 1 | ||
| 48 | #define RGBLIGHT_SLEEP | ||
| 49 | #endif | ||
diff --git a/keyboards/lazydesigners/the50/info.json b/keyboards/lazydesigners/the50/info.json new file mode 100644 index 000000000..16e751dac --- /dev/null +++ b/keyboards/lazydesigners/the50/info.json | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | { | ||
| 2 | "keyboard_name": "THE50", | ||
| 3 | "url": "http://lazydesigners.cn", | ||
| 4 | "maintainer": "qmk", | ||
| 5 | "width": 15.25, | ||
| 6 | "height": 4, | ||
| 7 | "layouts": { | ||
| 8 | "LAYOUT": { | ||
| 9 | "key_count": 54, | ||
| 10 | "layout": [ | ||
| 11 | {"label":"Esc", "x":0, "y":0}, | ||
| 12 | {"label":"Q", "x":1, "y":0}, | ||
| 13 | {"label":"W", "x":2, "y":0}, | ||
| 14 | {"label":"E", "x":3, "y":0}, | ||
| 15 | {"label":"R", "x":4, "y":0}, | ||
| 16 | {"label":"T", "x":5, "y":0}, | ||
| 17 | {"label":"Y", "x":6, "y":0}, | ||
| 18 | {"label":"U", "x":7, "y":0}, | ||
| 19 | {"label":"I", "x":8, "y":0}, | ||
| 20 | {"label":"O", "x":9, "y":0}, | ||
| 21 | {"label":"P", "x":10, "y":0}, | ||
| 22 | {"label":"Back<br>Space", "x":11, "y":0}, | ||
| 23 | {"label":"7", "x":12.25, "y":0}, | ||
| 24 | {"label":"8", "x":13.25, "y":0}, | ||
| 25 | {"label":"9", "x":14.25, "y":0}, | ||
| 26 | {"label":"Tab", "x":0, "y":1, "w":1.25}, | ||
| 27 | {"label":"A", "x":1.25, "y":1}, | ||
| 28 | {"label":"S", "x":2.25, "y":1}, | ||
| 29 | {"label":"D", "x":3.25, "y":1}, | ||
| 30 | {"label":"F", "x":4.25, "y":1}, | ||
| 31 | {"label":"G", "x":5.25, "y":1}, | ||
| 32 | {"label":"H", "x":6.25, "y":1}, | ||
| 33 | {"label":"J", "x":7.25, "y":1}, | ||
| 34 | {"label":"K", "x":8.25, "y":1}, | ||
| 35 | {"label":"L", "x":9.25, "y":1}, | ||
| 36 | {"label":"Enter", "x":10.25, "y":1, "w":1.75}, | ||
| 37 | {"label":"4", "x":12.25, "y":1}, | ||
| 38 | {"label":"5", "x":13.25, "y":1}, | ||
| 39 | {"label":"6", "x":14.25, "y":1}, | ||
| 40 | {"label":"Shift", "x":0, "y":2, "w":1.75}, | ||
| 41 | {"label":"Z", "x":1.75, "y":2}, | ||
| 42 | {"label":"X", "x":2.75, "y":2}, | ||
| 43 | {"label":"C", "x":3.75, "y":2}, | ||
| 44 | {"label":"V", "x":4.75, "y":2}, | ||
| 45 | {"label":"B", "x":5.75, "y":2}, | ||
| 46 | {"label":"N", "x":6.75, "y":2}, | ||
| 47 | {"label":"M", "x":7.75, "y":2}, | ||
| 48 | {"label":"<", "x":8.75, "y":2}, | ||
| 49 | {"label":">", "x":9.75, "y":2}, | ||
| 50 | {"label":"Fn", "x":10.75, "y":2, "w":1.25}, | ||
| 51 | {"label":"1", "x":12.25, "y":2}, | ||
| 52 | {"label":"2", "x":13.25, "y":2}, | ||
| 53 | {"label":"3", "x":14.25, "y":2}, | ||
| 54 | {"label":"Hyper", "x":0, "y":3, "w":1.25}, | ||
| 55 | {"label":"Super", "x":1.25, "y":3}, | ||
| 56 | {"label":"Meta", "x":2.25, "y":3, "w":1.25}, | ||
| 57 | {"label":"Space", "x":3.5, "y":3, "w":2.25}, | ||
| 58 | {"label":"Space", "x":5.75, "y":3, "w":2.75}, | ||
| 59 | {"label":"Meta", "x":8.5, "y":3, "w":1.25}, | ||
| 60 | {"label":"Super", "x":9.75, "y":3}, | ||
| 61 | {"label":"Hyper", "x":10.75, "y":3, "w":1.25}, | ||
| 62 | {"label":"0", "x":12.25, "y":3}, | ||
| 63 | {"label":".", "x":13.25, "y":3}, | ||
| 64 | {"label":"Enter", "x":14.25, "y":3}] | ||
| 65 | } | ||
| 66 | } | ||
| 67 | } | ||
diff --git a/keyboards/lazydesigners/the50/keymaps/default/keymap.c b/keyboards/lazydesigners/the50/keymaps/default/keymap.c new file mode 100644 index 000000000..cba582cab --- /dev/null +++ b/keyboards/lazydesigners/the50/keymaps/default/keymap.c | |||
| @@ -0,0 +1,59 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | |||
| 3 | enum custom_layers { | ||
| 4 | _QWERTY, | ||
| 5 | _FN | ||
| 6 | }; | ||
| 7 | |||
| 8 | // Act as Shift on hold and as CapsLock on tap | ||
| 9 | #define SFT_CPS LSFT_T(KC_CAPS) | ||
| 10 | |||
| 11 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 12 | |||
| 13 | /* Qwerty | ||
| 14 | * ,-----------------------------------------------------------. ,--------------. | ||
| 15 | * |Esc | Q | W | E | R | T | Y | U | I | O | P |Bspc| | 7 | 8 | 9 | | ||
| 16 | * |-----------------------------------------------------------| |--------------| | ||
| 17 | * | Tab | A | S | D | F | G | H | J | K | L | Enter | | 4 | 5 | 6 | | ||
| 18 | * |-----------------------------------------------------------| |--------------| | ||
| 19 | * | Shift | Z | X | C | V | B | N | M | , | . | FN | | 1 | 2 | 3 | | ||
| 20 | * |-----------------------------------------------------------| |--------------| | ||
| 21 | * | Ctrl |Gui | Alt | Space | Space | RAlt |RGui|RCtrl| | 0 | . |Entr| | ||
| 22 | * `-----------------------------------------------------------' `--------------' | ||
| 23 | */ | ||
| 24 | |||
| 25 | [_QWERTY] = LAYOUT( | ||
| 26 | KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_7, KC_8, KC_9, | ||
| 27 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, KC_4, KC_5, KC_6, | ||
| 28 | SFT_CPS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MO(_FN), KC_1, KC_2, KC_3, | ||
| 29 | KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_0, KC_DOT, KC_ENT | ||
| 30 | ), | ||
| 31 | |||
| 32 | /* FN | ||
| 33 | * ,-----------------------------------------------------------. ,--------------. | ||
| 34 | * |RST | | | | | | | | | |Ins |Del | |Home|PgUp| | | ||
| 35 | * |-----------------------------------------------------------| |--------------| | ||
| 36 | * | |Prev|Play|Next| | | |VolD|Mute|VolU| | |End |PgDn| | | ||
| 37 | * |-----------------------------------------------------------| |--------------| | ||
| 38 | * | | | | | | | | | | | | | | | | | ||
| 39 | * |-----------------------------------------------------------| |--------------| | ||
| 40 | * |EEPRST| | | | | | | | | | | | | ||
| 41 | * `-----------------------------------------------------------' `--------------' | ||
| 42 | */ | ||
| 43 | |||
| 44 | [_FN] = LAYOUT( | ||
| 45 | RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_DEL, KC_HOME, KC_PGUP, _______, | ||
| 46 | _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, KC_END, KC_PGDN, _______, | ||
| 47 | _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, | ||
| 48 | EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ | ||
| 49 | ) | ||
| 50 | }; | ||
| 51 | |||
| 52 | void led_set_user(uint8_t usb_led) { | ||
| 53 | // Turn LED On/Off for Caps Lock | ||
| 54 | if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { | ||
| 55 | the50_led_on(); | ||
| 56 | } else { | ||
| 57 | the50_led_off(); | ||
| 58 | } | ||
| 59 | } | ||
diff --git a/keyboards/lazydesigners/the50/keymaps/default/readme.md b/keyboards/lazydesigners/the50/keymaps/default/readme.md new file mode 100644 index 000000000..09b9351f9 --- /dev/null +++ b/keyboards/lazydesigners/the50/keymaps/default/readme.md | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | # Default keymap for THE50 | ||
| 2 | |||
| 3 | **Features** | ||
| 4 | |||
| 5 | * Shift acts as CapsLock when tapped | ||
| 6 | |||
| 7 | ## QWERTY (Normal) Layer | ||
| 8 | ``` | ||
| 9 | ,-----------------------------------------------------------. ,--------------. | ||
| 10 | |Esc | Q | W | E | R | T | Y | U | I | O | P |Bspc| | 7 | 8 | 9 | | ||
| 11 | |-----------------------------------------------------------| |--------------| | ||
| 12 | | Tab | A | S | D | F | G | H | J | K | L | Enter | | 4 | 5 | 6 | | ||
| 13 | |-----------------------------------------------------------| |--------------| | ||
| 14 | | Shift | Z | X | C | V | B | N | M | , | . | FN | | 1 | 2 | 3 | | ||
| 15 | |-----------------------------------------------------------| |--------------| | ||
| 16 | | Ctrl |Gui | Alt | Space | Space | RAlt |RGui|RCtrl| | 0 | . |Entr| | ||
| 17 | `-----------------------------------------------------------' `--------------' | ||
| 18 | ``` | ||
| 19 | |||
| 20 | ## FN Layer | ||
| 21 | ``` | ||
| 22 | ,-----------------------------------------------------------. ,--------------. | ||
| 23 | |RST | | | | | | | | | |Ins |Del | |Home|PgUp| | | ||
| 24 | |-----------------------------------------------------------| |--------------| | ||
| 25 | | |Prev|Play|Next| | | |VolD|Mute|VolU| | |End |PgDn| | | ||
| 26 | |-----------------------------------------------------------| |--------------| | ||
| 27 | | | | | | | | | | | | | | | | | | ||
| 28 | |-----------------------------------------------------------| |--------------| | ||
| 29 | |EEPRST| | | | | | | | | | | | | ||
| 30 | `-----------------------------------------------------------' `--------------' | ||
| 31 | ``` | ||
diff --git a/keyboards/lazydesigners/the50/readme.md b/keyboards/lazydesigners/the50/readme.md new file mode 100644 index 000000000..d90dc59de --- /dev/null +++ b/keyboards/lazydesigners/the50/readme.md | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | # THE50 | ||
| 2 | |||
| 3 |  | ||
| 4 | |||
| 5 | A 50% custom keyboard designed and produced by [LazyDesigners](http://lazydesigners.cn). | ||
| 6 | |||
| 7 | Keyboard Maintainer: QMK Community | ||
| 8 | Hardware Supported: THE50 | ||
| 9 | Hardware Availability: Check for GBs on [Geekhack](https://geekhack.org) and on [LazyDesigner's homepage.](http://lazydesigners.cn) | ||
| 10 | |||
| 11 | Make example for this keyboard (after setting up your build environment): | ||
| 12 | |||
| 13 | make lazydesigners/the50:default:dfu | ||
| 14 | |||
| 15 | To enter the bootloader, either short the pins on the PCB or the RESET button on the FN layer. | ||
| 16 | |||
| 17 | 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/lazydesigners/the50/rules.mk b/keyboards/lazydesigners/the50/rules.mk new file mode 100644 index 000000000..ae211ec66 --- /dev/null +++ b/keyboards/lazydesigners/the50/rules.mk | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | # MCU name | ||
| 2 | MCU = 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. | ||
| 15 | F_CPU = 16000000 | ||
| 16 | |||
| 17 | # | ||
| 18 | # LUFA specific | ||
| 19 | # | ||
| 20 | # Target architecture (see library "Board Types" documentation). | ||
| 21 | ARCH = 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. | ||
| 34 | F_USB = $(F_CPU) | ||
| 35 | |||
| 36 | # Interrupt driven control endpoint task(+60) | ||
| 37 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | ||
| 38 | |||
| 39 | BOOTLOADER = atmel-dfu | ||
| 40 | |||
| 41 | # Build Options | ||
| 42 | # comment out to disable the options. | ||
| 43 | # | ||
| 44 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | ||
| 45 | MOUSEKEY_ENABLE = yes # Mouse keys(+4700) | ||
| 46 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | ||
| 47 | CONSOLE_ENABLE = no # Console for debug(+400) | ||
| 48 | COMMAND_ENABLE = no # Commands for debug and configuration | ||
| 49 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | ||
| 50 | NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | ||
| 51 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | ||
| 52 | RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality | ||
diff --git a/keyboards/lazydesigners/the50/the50.c b/keyboards/lazydesigners/the50/the50.c new file mode 100644 index 000000000..4ceb3da6a --- /dev/null +++ b/keyboards/lazydesigners/the50/the50.c | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | #include "the50.h" | ||
| 2 | |||
| 3 | void the50_led_on() { | ||
| 4 | DDRB |= (1 << 7); PORTB &= ~(1 << 7); | ||
| 5 | } | ||
| 6 | |||
| 7 | void the50_led_off() { | ||
| 8 | DDRB &= ~(1 << 7); PORTB &= ~(1 << 7); | ||
| 9 | } | ||
diff --git a/keyboards/lazydesigners/the50/the50.h b/keyboards/lazydesigners/the50/the50.h new file mode 100644 index 000000000..1cf613aad --- /dev/null +++ b/keyboards/lazydesigners/the50/the50.h | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include "quantum.h" | ||
| 4 | |||
| 5 | #define XXXX KC_NO | ||
| 6 | |||
| 7 | /* | ||
| 8 | * ,-----------------------------------------------------------. ,--------------. | ||
| 9 | * | | | | | | | | | | | | | | | | | | ||
| 10 | * |-----------------------------------------------------------| |--------------| | ||
| 11 | * | | | | | | | | | | | | | | | | | ||
| 12 | * |-----------------------------------------------------------| |--------------| | ||
| 13 | * | | | | | | | | | | | | | | | | | ||
| 14 | * |-----------------------------------------------------------| |--------------| | ||
| 15 | * | | | | | | | | | | | | | | ||
| 16 | * `-----------------------------------------------------------' `--------------' | ||
| 17 | */ | ||
| 18 | |||
| 19 | #define LAYOUT( \ | ||
| 20 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ | ||
| 21 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K111, K112, K113, K114, \ | ||
| 22 | K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ | ||
| 23 | K300, K301, K302, K304, K307, K309, K310, K311, K312, K313, K314 \ | ||
| 24 | ) { \ | ||
| 25 | { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ | ||
| 26 | { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, XXXX, K111, K112, K113, K114 }, \ | ||
| 27 | { K200, XXXX, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ | ||
| 28 | { K300, K301, K302, XXXX, K304, XXXX, XXXX, K307, XXXX, K309, K310, K311, K312, K313, K314 } \ | ||
| 29 | } | ||
| 30 | |||
| 31 | void the50_led_on(void); | ||
| 32 | void the50_led_off(void); | ||
