From aee0f3c3d2a3de8fd8a97af3ca022755dff95a57 Mon Sep 17 00:00:00 2001 From: Will Date: Tue, 31 Jul 2018 14:19:45 +0800 Subject: [PATCH] Keymap: Fate Iris layout (#3508) --- keyboards/iris/keymaps/fate/config.h | 40 ++++++++ keyboards/iris/keymaps/fate/keymap.c | 126 ++++++++++++++++++++++++++ keyboards/iris/keymaps/fate/readme.md | 23 +++++ keyboards/iris/keymaps/fate/rules.mk | 7 ++ 4 files changed, 196 insertions(+) create mode 100644 keyboards/iris/keymaps/fate/config.h create mode 100644 keyboards/iris/keymaps/fate/keymap.c create mode 100644 keyboards/iris/keymaps/fate/readme.md create mode 100644 keyboards/iris/keymaps/fate/rules.mk diff --git a/keyboards/iris/keymaps/fate/config.h b/keyboards/iris/keymaps/fate/config.h new file mode 100644 index 000000000..5f16bffb7 --- /dev/null +++ b/keyboards/iris/keymaps/fate/config.h @@ -0,0 +1,40 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#pragma once + +/* QMK DFU configuration */ +#define QMK_ESC_OUTPUT F6 +#define QMK_ESC_INPUT D7 +#define QMK_LED D5 +#define QMK_SPEAKER C6 + +/* Use I2C or Serial, not both */ +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/iris/keymaps/fate/keymap.c b/keyboards/iris/keymaps/fate/keymap.c new file mode 100644 index 000000000..ca92b5978 --- /dev/null +++ b/keyboards/iris/keymaps/fate/keymap.c @@ -0,0 +1,126 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum iris_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _NUMPAD +}; + +// Tap Dance Declarations +enum { + TD_LALT_LGUI = 0, + TD_RALT_RGUI +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_LOWR MO(_LOWER) +#define KC_RASE MO(_RAISE) +#define KC_NUM TG(_NUMPAD) +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_BL_S BL_STEP +#define KC_RTOG RGB_TOG +#define KC_RMD RGB_MOD +#define KC_RRMD RGB_RMOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD + +#define KC_LAG TD(TD_LALT_LGUI) +#define KC_RAG TD(TD_RALT_RGUI) +#define KC_RSEN MT(MOD_RSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,ENT , ENT , N , M ,COMM,DOT ,SLSH,RSEN, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LAG ,LOWR,SPC , SPC ,RASE,RAG + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CAPS, ,HOME, UP ,END ,PGUP, LEFT,DOWN, UP ,RGHT,INS ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,TILD,LEFT,DOWN,RGHT,PGDN, ,UNDS,PLUS,LCBR,RCBR,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MPLY,MPRV,MNXT,VOLD,VOLU, , ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + CAPS, ,BTN1,MS_U,BTN2,WH_U, LEFT,DOWN, UP ,RGHT,INS ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,GRV ,MS_L,MS_D,MS_R,WH_D, ,MINS,EQL ,LBRC,RBRC,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MPLY,MPRV,MNXT,VOLD,VOLU, , ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RMD ,RHUI,RSAI,RVAI,RTOG, ,PSCR,SLCK,PAUS, , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,RRMD,RHUD,RSAD,RVAD,BL_S, LEFT,DOWN, UP ,RGHT, , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,DBUG, , , ,RST ,NUM , NUM ,HOME,PGDN,PGUP,END ,APP , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_NUMPAD] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , NLCK, P7 , P8 , P9 ,PSLS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , P4 , P5 , P6 ,PAST, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , P1 , P2 , P3 ,PPLS,ENT , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , P0 , P0 ,PDOT,PMNS, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +// Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // Tap once for L-Alt, twice for L-GUI + [TD_LALT_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_LGUI), + // Tap once for R-Alt, twice for R-GUI + [TD_RALT_RGUI] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_RGUI) +}; diff --git a/keyboards/iris/keymaps/fate/readme.md b/keyboards/iris/keymaps/fate/readme.md new file mode 100644 index 000000000..70f464b0d --- /dev/null +++ b/keyboards/iris/keymaps/fate/readme.md @@ -0,0 +1,23 @@ +# Fate Iris Layout + +This keymap is configured for Pro Micro(s) with QMK-DFU bootloader flashed. Please refer to [this guide](https://www.reddit.com/r/olkb/comments/8sxgzb/replace_pro_micro_bootloader_with_qmk_dfu/) for further details on ISP flashing your Pro Micro. + +To generate a production-ready .hex file (containing the application and the bootloader), use the production target + + make iris/rev2:fate:production + +To replace your Pro Micro with QMK-DFU bootloader along with the keymap, setup your ISP Flasher and avrdude, run (This command assumes you're using SparkFun's Pocket AVR Programmer to program): + + $ avrdude -p m32u4 -P usb -c usbtiny -U flash:w:"iris_rev2_fate_production.hex" -U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m -U lock:w:0x3F:m -v + +Command to replace your Pro Micro with QMK-DFU bootloader only: + + $ avrdude -p m32u4 -P usb -c usbtiny -U flash:w:"iris_rev2_fate_bootloader.hex" -U lfuse:w:0x5E:m -U hfuse:w:0xD9:m -U efuse:w:0xC3:m -U lock:w:0x3F:m -v + +The QMK_ESC is mapped to the ESC key in keymap.c; QMK_LED is mapped to TX_LED on the Pro Micro. + + /* QMK DFU configuration */ + #define QMK_ESC_OUTPUT F6 + #define QMK_ESC_INPUT D7 + #define QMK_LED D5 + #define QMK_SPEAKER C6 diff --git a/keyboards/iris/keymaps/fate/rules.mk b/keyboards/iris/keymaps/fate/rules.mk new file mode 100644 index 000000000..378a653d9 --- /dev/null +++ b/keyboards/iris/keymaps/fate/rules.mk @@ -0,0 +1,7 @@ +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = qmk-dfu + +TAP_DANCE_ENABLE = yes